01-23-2007 10:15
Not sure about this, I have a chair only I can sit on. The script stops people from sitting on it, but when I sit on it the script allows anyone to sit on it with me. Any tips?

key sitter;
string SIT = "";
vector sitrot = <0.0, 0.0, 0.0>;//
vector sitpos = <0.25, 0.0, 0.5>;//


default
{
state_entry()
{
llSetSitText("Sit, my King";);
llSitTarget( sitpos, llEuler2Rot(sitrot * DEG_TO_RAD) ); //
}
on_rez(integer start_param)
{
llResetScript();
}

changed(integer change)
{
if (change & CHANGED_LINK)
{
sitter = llAvatarOnSitTarget();
if (sitter != NULL_KEY)
{
if ( sitter != llGetOwner())
{
llUnSit(sitter);
llSay(0, "Super Barbecue is the King. You Fool.";);
return;
}
else
{
llRequestPermissions(sitter, PERMISSION_TRIGGER_ANIMATION);
}
}
else
{
if(SIT != "";)
llStopAnimation( SIT);
}
}
}

run_time_permissions(integer perm)
{
if(perm)
{
llSleep(0.2);
if (SIT != "";)
{
llStopAnimation("sit";);
llStartAnimation( SIT );
}
}
}

}