|
Phenicia Gravois
Registered User
Join date: 3 Nov 2008
Posts: 70
|
12-15-2008 05:16
here is a copy of the script I have:
string name;
default {
touch_start(integer total_number) { if(llSameGroup(llDetectedKey(0))){llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_OBJECT,0));} } }
It should give an object only to group members, but when i try it, a message says that it's unable to give an object because no item was named
Where should i name the item I am giving? Also do I put the item in a box with the script? Or do I just put the script by itself in a box with the object named in the script?
Also how do I set which group i want to give the items to?
|
|
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
|
12-15-2008 05:42
"llGiveInventory" only works on objects in the same object as the script, so you do need to put the item in the same box. Replace this: "llGetInventoryName(INVENTORY_OBJE CT,0)", from your script with the name of the object you want to give.
You can set the group by opening the "Edit" window for the box, and underneath the bit where it says "Creator" and "Owner", you'll see the group it's assigned to. Click the button to change it there. (By default, it will take on whatever group you are actively assigned to when you created/rezzed it.)
EDIT: incidentally, the script as you have it just now will actually give the first object in the box's inventory (I think it works alphabetically, but I'm not sure). The problem is obviously occurring because there are no objects in its inventory.
|
|
Phenicia Gravois
Registered User
Join date: 3 Nov 2008
Posts: 70
|
12-15-2008 05:44
From: Pedro McMillan "llGiveInventory" only works on objects in the same object as the script, so you do need to put the item in the same box. Replace this: "llGetInventoryName(INVENTORY_OBJE CT,0)", from your script with the name of the object you want to give.
You can set the group by opening the "Edit" window for the box, and underneath the bit where it says "Creator" and "Owner", you'll see the group it's assigned to. Click the button to change it there. (By default, it will take on whatever group you are actively assigned to when you created/rezzed it.) Ok, that helps a lot already, but where do I name the item that is to be given?
|
|
Georg Stonewall
Husband of Nikki
Join date: 21 Jan 2007
Posts: 211
|
12-15-2008 05:45
From: Phenicia Gravois llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_OBJE CT,0));
Hi Phenicia, is it only a typo in this post, or is there a space in INVENTORY_OBJECT in your script as well?
_____________________
G&N Quality Design SLURL  Blog  Flickr  XStreetSL 
|
|
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
|
12-15-2008 05:49
The script wouldn't have compiled if that space was actually in there, so I assume it was just a typo in posting it. Phenicia, I think you must have replied while I was editing my post to add in the bit about naming the object. 
|
|
Phenicia Gravois
Registered User
Join date: 3 Nov 2008
Posts: 70
|
12-15-2008 06:08
From: Georg Stonewall Hi Phenicia,
is it only a typo in this post, or is there a space in INVENTORY_OBJECT in your script as well? In the script there is no space there.
|
|
Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
|
12-15-2008 07:43
Any way to get the script to give everything in the prims inventory to the group, well except the script that gives it all? I had tried that same script (found on the wiki) and it would't give me anything in the inventory.
|
|
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
|
12-15-2008 09:16
That particular script only gives objects, and will only give the first one. You can use the function "llGiveInventoryList" to give several items all at once. There's loads of info on the wiki about it: http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGiveInventoryList
|