Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to make a notecard give on rez?

Eva Tiramisu
Registered User
Join date: 20 Sep 2005
Posts: 176
07-25-2007 10:24
So, I am trying to make an object give out a notecard when its rezzed.
But since I cant really script, I cant find out what i do wrong here ....

I started with this script, that gives on touch:

________________
default
{
touch(integer param)
{
llGiveInventory(llDetectedKey(0), "NOTECARD";);
}
}
_____________

And this works fine.

But since I want this to happen at rez, i figured this would work:

______________
default
{
on_rez(integer param)
{
llGiveInventory(llDetectedKey(0), "NOTECARD";);
}
}
_____________


But it didnt.... So I tried to read the scripting guide, and it seems it needs (integer start_param) instead, but:

_________
default
{
on_rez(integer start_param)
{
llGiveInventory(llDetectedKey(0), "NOTECARD";);
}
}
__________

... doesnt work either....
So, now I am kinda lost. Anyone knows why its not working?
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
07-25-2007 11:03
Who are you trying to give the notecard to? llDetectedKey(0) has no meaning inside the on_rez Event Handler. llGetOwner() should do something though. :)

See: http://www.lslwiki.net/lslwiki/wakka.php?wakka=detected for Detection Functions and Events
Eva Tiramisu
Registered User
Join date: 20 Sep 2005
Posts: 176
07-25-2007 11:39
Thank you :)