Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

kill script that don't work for anyone else

Robin Peel
Registered User
Join date: 8 Feb 2005
Posts: 163
07-19-2005 13:59
hello,
i have a problem. i use this kill script, but when i give the object to others they can't use it without saving the script. then it will work for them without a problem.
here's the script, if anyone can help...thanks

default
{
state_entry()
{
llListen(0, "", llGetOwner(), "die";);
}

on_rez(integer start_param)
{
llResetScript();
}

listen(integer channel, string name, key id, string message)
{
llDie();
}
}
Burke Prefect
Cafe Owner, Superhero
Join date: 29 Oct 2004
Posts: 2,785
07-19-2005 15:48
Sounds like it's not getting completely reset when it's transferred, which is odd. You already have it reset on rez... hmmmm.

i'm sure someone can give you a better solution.
Minsk Oud
Registered User
Join date: 12 Jul 2005
Posts: 85
07-19-2005 15:58
<edit>Whoops, lemme delete that as it's blazingly wrong.</edit>
Jim Bunderfeld
The Coder
Join date: 1 Mar 2004
Posts: 161
07-19-2005 16:39
CODE

default
{
state_entry()
{
llListen(0,"",llGetOwner(),"die");
}
on_rez(integer rezed)
{
llListen(0,"",llGetOwner(),"die");
}
listen(integer channel,string name,key id,string message)
{
llDie();
}
}
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
07-19-2005 17:11
If you're selling or giving someone the original copy of the object, on_rez won't be triggered.

Try adding in the following event handler:
CODE
changed(integer change)
{
if (change & 128)
{
llResetScript();
}
}
The changed() event is triggered when ownership of the object changes. (among many other things) Ownership changes can be filtered by checking the "change" parameter for the "ownership" bitflag, 128. (Unlike the rest of the "CHANGED_*" constants, there's no corresponding constant for ownership.)

See the changed() page for more.
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Robin Peel
Registered User
Join date: 8 Feb 2005
Posts: 163
07-19-2005 17:26
From: Catherine Omega
If you're selling or giving someone the original copy of the object, on_rez won't be triggered.

Try adding in the following event handler:
CODE
changed(integer change)
{
if (change & 128)
{
llResetScript();
}
}
The changed() event is triggered when ownership of the object changes. (among many other things) Ownership changes can be filtered by checking the "change" parameter for the "ownership" bitflag, 128. (Unlike the rest of the "CHANGED_*" constants, there's no corresponding constant for ownership.)

See the changed() page for more.

I was giving an original copy away, it never worked right unless they saved the script, and i didn't want them to have modify rights to it.
Adding this to it worked perfect.
Thanks
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
07-20-2005 04:58
From: Catherine Omega
If you're selling or giving someone the original copy of the object, on_rez won't be triggered.
Excuse me Catherine, but I want to know. Although surely handing over won't fire on_rez event, when the person who was received it rez it on ground to use it, can't it fire and will not the script be available?
_____________________
:) Seagel Neville :)
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
07-20-2005 17:45
From: Seagel Neville
Excuse me Catherine, but I want to know. Although surely handing over won't fire on_rez event, when the person who was received it rez it on ground to use it, can't it fire and will not the script be available?
Yes, but the changed() event will cover all bases.
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
07-20-2005 20:11
I'm wondering why Robin's friends had to save (or reset?) the script when they used it.

Anyway, I understand I'd better put the changed() event when I use llGetOwner by way of precaution. Thanks. :)
_____________________
:) Seagel Neville :)