Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help with a script for a tail... giving item

MortVent Charron
Can haz cuddles now?
Join date: 21 Sep 2007
Posts: 1,942
02-03-2008 01:18
I am modding a script for a tail to give a picture when a certain option is selected. The emote part works, but they do not get the picture and everything looks right but doesn't work.

It compiles correctly though and runs, just no delivery.


if(action == "Picture")
{
llSay(0," "+n + "takes a picture of " + owner + "'s cute tail");
llGiveInventory(llDetectedKey(0), "Tail Pic!");
}

I have tried it with llGetInventory(INVENTORY_TEXTURE,0) instead of the actual name as well

Any help would be appreciated, and I can send the tail script in world if needed... only thing I can see is it is not detecting the person that clicked or not working right since it is an avatar attachment
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
02-03-2008 01:56
I suspect your code snippet is in an Event handler that cannot use llDetectedKey. If you're in the listen Event handler, for example, you can use the 'key id' coming from the listen...

llGiveInventory(id, "Tail Pic!";);

In other circumstances you may have to preserve the detected key in a Global variable for later use.

Check here: for the list of valid Detection Events.
MortVent Charron
Can haz cuddles now?
Join date: 21 Sep 2007
Posts: 1,942
02-03-2008 16:34
yeah, had to use a global variable for the key set on touch.

It had if statements under it, but didn't pull the variable down.