01-23-2007 10:18
I have a script that only allows the owner to sit on an object, but when I am on it the script see's me on there and allows anyone to sit there too! Any help would be ace.

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 );
}
}
}

}