Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llGetOwner not working

Azul Wilder
Registered User
Join date: 29 Jan 2007
Posts: 87
04-12-2007 10:09
Hi everybody!

I have an script that uses a llListen to hear the commands from the owner but it doesn't work I used it in two different ways:

CODE
llListen(0, "", llGetOwner(), "");


and

CODE
llListen(0, "", llGetOwnerKey(llGetOwner()), "");


In both cases when the object is transfered to a new owner, it doesn't listen to the owner, but to the creator.

Does anyone know why? and how to solve this?

Thanks a lot.
_____________________
First goes before
AW Devices
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
04-12-2007 10:26
Check the changed event - it will tell you when the owner changes and you can re-do the listens.

If you don't have state/data that you need to persist across owner changes, maybe something like this...
CODE

changed (integer mask)
{
if (mask & CHANGED_OWNER)
{
llResetScript();
}
}
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
04-12-2007 11:02
Basically you have the listen called in a section of the script that has not reset since it was originally compiled so it's just continued to listen to the creator.

You could do as shown above, or just reset the script on rez.

I typically have all of my initialization items such as sit targets, etc, in events that only fire on rez.