Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Trouble with llRezObject()

Wiggy Undertone
Registered User
Join date: 4 Jun 2006
Posts: 8
07-21-2007 11:55
Hi Folks,

I'm having trouble with the following script. The script is placed in an object which gets rezzed by another object (to get around the 10 meter limit). The script works fine if I take it out of inventory, but doesn't work when rezzed by the other object.

Thanks in advance.



[PHP]
default
{
on_rez(integer param)
{
llResetScript();
}

state_entry()
{
llSleep(2.0);
vector my_pos = llGetPos();
llRezObject("my_object", my_pos + <0.0, 0.0, 5.0> , ZERO_VECTOR, ZERO_ROTATION, 0);
llSleep(10.0);
llDie();
}
}
[/PHP]
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
07-21-2007 12:55
Does it work when you rez the object straight out of the rezzer's contents? I suspect that the copy in your prim is already in the llSleep(10) and will just die when rezzed.

Try moving all of state_entry into on_rez and remove state_entry, and remove the llResetScript.

Then at least you won't have to immediately copy it once you save the script in it.
Wiggy Undertone
Registered User
Join date: 4 Jun 2006
Posts: 8
07-21-2007 17:37
Thanks for the advice. It's working as I wanted with your changes.