Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

need a little help with llGetOwner

maihem Sinister
Registered User
Join date: 7 Oct 2008
Posts: 29
08-31-2009 10:25
Void Singer made this script to help me with a door script, problem is though if i give the object that contains the script to some one they can not open the door.
I tried to contact Void in world but never heard back assuming she is busy so i am asking you all for help :)
cheers
this is the chat trigger script

default{
state_entry(){
llListen( 1, "", llGetOwner(), "gear" );
}

listen( integer vInt, string vStr, key vKey, string vStrNull ){
llMessageLinked( LINK_SET, 0, "v7-D Hinge", "" );
}
}

and this is the hinge script ( i dont know if it is needed to post but i thought i should just in case


float flt_DEGREES_TO_ROTATE = 45;
float flt_TIME_TO_ROTATE = 2;

float gFltSpn;
rotation gRotAng;

default{
state_entry(){
gRotAng = llEuler2Rot( < (-flt_DEGREES_TO_ROTATE * DEG_TO_RAD), 0.0, 0.0 > );
gFltSpn = -flt_DEGREES_TO_ROTATE * DEG_TO_RAD / flt_TIME_TO_ROTATE;
}

link_message( integer vInt, integer vIntNull, string vStrCmd, key vKey ){
if ("v7-D Hinge" == vStrCmd ){
llTargetOmega( (< 1.0, 0.0, 0.0 > * llGetLocalRot()), (gFltSpn *= -1), 1.0 );
llSleep( flt_TIME_TO_ROTATE );
llTargetOmega( ZERO_VECTOR, 0.0, 0.0 );
llSetLocalRot( (gRotAng = (ZERO_ROTATION / gRotAng)) * llGetLocalRot() );
}
}
}
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
08-31-2009 10:38
Change the chat trigger script to this.. I just added a changed() handler in there..

CODE

default
{
state_entry()
{
llListen( 1, "", llGetOwner(), "gear" );
}

listen( integer vInt, string vStr, key vKey, string vStrNull )
{
llMessageLinked( LINK_SET, 0, "v7-D Hinge", "" );
}

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
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
08-31-2009 11:34
or let the new owner reset the script;)
_____________________
From Studio Dora
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
08-31-2009 12:59
From: Dora Gustafson
or let the new owner reset the script;)

Could work, but then the question becomes: should the new owner have to know to reset the script, if it can instead be done automatically without any harm done?
Nezu Garside
Custom titles are too sho
Join date: 12 Mar 2008
Posts: 40
08-31-2009 13:17
It's also good practice to set up the code to reset on_rez() if you are planning on selling it to new owners. Occasionally SL likes to freak out over change() code in recent updates. At least, this has happened to me and a few others... Any who, the code snippet is..

default
{
on_rez(integer start_param)
{
llResetScript();
}
}
maihem Sinister
Registered User
Join date: 7 Oct 2008
Posts: 29
08-31-2009 13:39
thanks very much for the help :)
we did try the script reset, it didn't seem to help?
but this fix you posted is very much appreciated :)
Raster Teazle
Registered User
Join date: 13 Sep 2005
Posts: 114
08-31-2009 19:47
If the door was deeded to group owned land the new owner would be the group. You can not open a listen channel to a group.

If this is the case...

change this:
CODE

llListen( 1, "", llGetOwner(), "gear" );


to this:
CODE

llListen( 1, "", "", "gear" );