Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Weird issue with llGetOwner()

Furia Freeloader
Furiously Furia
Join date: 13 Dec 2005
Posts: 34
03-19-2006 11:54
Hi folks -

I'm having a strange issue with llGetOwner(). Here's my code snippet (this is on a worn attachment).

default
{
attach(key attached)
{
if (attached != NULL_KEY) // object has been //attached//
{
llResetScript();
}
}

touch_start(integer total_number)
{
if(llDetectedKey(0) == llGetOwner());
{
// This does something
}
}
}

I have the llResetScript() there so that, the script resets, in case it has been attached to a new owner, so that the Owner updates. But maybe this is just paranoia. I had some problems earlier with the script remembering the owner and not updating when it changed hands.

My issue is that it seems to let ANYONE touch and activate the script, despite the llGetOwner() line in the script. Can anyone tell me why? Has something changed?
Thanks.
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
03-19-2006 12:33
It's because you have a ; at the end of the IF

That ends the IF, and LSL just executes what is in the {} following.

You don't need to reset the script to have llGetOwner() return the owner properly.
_____________________
Furia Freeloader
Furiously Furia
Join date: 13 Dec 2005
Posts: 34
03-19-2006 17:24
omg no way!

Thanks. Works great now.