07-18-2007 00:25
Hi there, I am pulling my hair out over this one. It's late - or rather, early and I'm tired so I may well be missing something but I just cant see what.....

I have a *really* simple script such as...

CODE

default
{
on_rez(integer start_param)
{ }

state_entry() {}

attach(key attached)
{
if (attached != NULL_KEY)
{
// object is attached
} else {
// object is not attached
}
}
}


Ok so pretty basic stuff. Now that works fine, if i put an llSay or whatever in the attach event to check whats happening it fires no problem at all.

Then I come to bulking out the script. I will have a listen event listening on channel whatever such as

CODE


....

llListen(g_MyChannel, "", llGetOwner(), "");

....



Now as far as I understand it, if the code contains an llGetOwner then an llResetScript is required so that when the object goes from me [the creator] to Avatar X the script knows that he / she is the owner.

As soon as I put llResetScript in there it just destroys itself and goes haywire! For example, it stops listening. *completely*! It doesnt matter if it's on channel 0 or 99999999, the messages just dont get through

The particle effect (which is ONLY fired in the change event of teleport) fires when you rez the object on the ground and also when you right click on it.

I just don't understand it. Is there something about the attach event that doesnt like llResetScript? (this is the first time i have used that event). Am I just blind and am missing something really obvious?

It doesn't matter where the llResetScript is placed... it could be anywhere - as long as it is in the script *somewhere* then it breaks.

Any advice will be great!! Thank you :)