|
duLuna Bosatsu
OMnomnom nom.
Join date: 4 Nov 2007
Posts: 102
|
02-14-2008 17:51
So my friend want to turn his medical bag into something he can click and pull out a random item to use, is there any quick-and-easy script for this? I suppose it's similar to those vending machines or bar tenders out there with a list of drinks or what-have-you available to utilize.
any and all help is very appreciated! <3
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-14-2008 20:09
you could go the give route, using llGiveInventory, if you're looking for a menu of items on touch, you probably also want llDialog, and llListen. llListen would also be good for chat commands. the other route you could take instead of llGiveInventory, is llRezObject, which would rez the object inworld, after which the objects could be used or placed at whim, relying on whatever scripts they contain. a sample of how llGiveInventory works would go like this. default{ touch_start( integer vIntTouched ){
//-- check to make sure it's my owner if (llGetOwner() == llDetectedKey( 0 );
//-- check to see if I have an object if (llGetInventoryNumber( INVENTORY_OBJECT ){
//-- give the first object in inventory llGiveInventory( llGetOwner(), llGetInventoryName( INVENTORY_OBJECT, 0 );
//-- no inventory, tell the owner }else{ llOwnerSay( "I have nothing to give you" ); }
//-- not my owner, warn this person }else{ llInstantMessage( llDetectedKey( 0 ), "Only my owner can open me" ); } } }
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|