|
Samara Kasshiki
Registered User
Join date: 28 Sep 2006
Posts: 30
|
03-24-2008 11:48
Hi - Can someone point me to a script that will give the contents of a box for free to anyone with the correct group tag on -- and no one else? Know this isn't a huge deal as they seem to be around everywhere but I can't find anything on the forums. Thanks a bunch.
|
|
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
|
03-24-2008 12:43
to get you on the correct track, default { touch_start(integer total_number) { if(llSameGroup(llDetectedKey(0)))llGiveInventory(llDetectedKey(0),item); } }
the above will give the inventoy item number stored in item. Take a look at llGiveInventoryList() in the Wiki for examples of how to give several items.
|
|
Samara Kasshiki
Registered User
Join date: 28 Sep 2006
Posts: 30
|
03-24-2008 14:13
Thanks. Not a script guru obviously. I keep getting a "Name not defined within scope" error message to the code you posted. The error is after the "m" in "item". There is no info on GiveInventoryList in the wiki -- at least by doing a search  Would be happy to get ONE item to only people in the group. I can box (wink). Will play around with some other codes I have and maybe get it by accident. Thanks though.
|
|
Samara Kasshiki
Registered User
Join date: 28 Sep 2006
Posts: 30
|
Give Inventory Item only to people in Group Code
03-24-2008 14:27
Got it. Under SameGroup -- I found it in the wiki  ) default { touch_start(integer total_number) { if(llSameGroup(llDetectedKey(0)))//same as llDetectedGroup(0) (with llDetectedGroup, detected does not need to be in the sim) llGiveInventory(llDetectedKey(0), llGetInventoryName(INVENTORY_OBJECT,0)); else llSay(0, "Wrong active group!"  ; } } This works and has been tested for both people in and out of group. Yeah! Thanks again for mentioning the wiki.
|
|
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
|
03-24-2008 16:57
It's a pleasur, glad you found it and welcome to the wonderfull but addictivcve world of LSL scripting. Just to help you in future, the error you got was that the forum software put a space in the (l lDetectedKey(0),item) between the first 2 l's it is an annoying idiosynchrocy of the forum, but one to be aware of if using published code. And you would also need to declare and assign a value to item 
|