Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Changed Owner Help

Smith Peel
Smif v2.0
Join date: 10 Jan 2005
Posts: 1,597
08-30-2009 23:23
I have a script which I need to recognize that a change in ownership has happened; the only problem is that a script reset seems to completely bork the script. Is there a way around this? I've tried the below to no avail:



{
changed(integer change)
{
if (change & CHANGED_OWNER)
llResetScript();



It works fine for the original owner, but when transferred and the reset is activated, the script is borked. SOS?
_____________________
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
08-30-2009 23:33
What script is borked?
What is borked?
What does it do that it shouldn't?
What does it not do?
What do you think it should do?
What do you want it to do?
What do you want from the group?
_____________________
From Studio Dora
Smith Peel
Smif v2.0
Join date: 10 Jan 2005
Posts: 1,597
08-30-2009 23:41
Is there another way to get the thing to recognize a new owner without a script reset? That is my first question.
_____________________
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
08-31-2009 00:39
From: Smith Peel
Is there another way to get the thing to recognize a new owner without a script reset? That is my first question.
Yes!
CODE

changed(integer change)
{
if (change & CHANGED_OWNER)
{
// Do your stuff here, but do not reset the script!
// when you reset the script it starts from scratch
// and runs the state_entry() event handler
}
}
_____________________
From Studio Dora
EF Klaar
Registered User
Join date: 11 Jun 2007
Posts: 330
08-31-2009 00:45
key owner;
default
{
state_entry ()
{
owner = llGetOwner ();
//etc...
}
changed (integer change)
{
if (change & CHANGED_OWNER)
{
owner = llGetOwner ();
//etc...
}
}
//etc...
}
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
llResetScript: Uses and Abuses
08-31-2009 02:22
_____________________