I'm very new to scripting and mostly just use poseball scripts in the furniture I make. I have a neat little script which works great for chairs with a single pose in them. The problem is that when I have two poses in one object (e.g. in a sofa) then when you sit on one poseball (or stand up) the other gives the following error:
Script trying to stop animations but PERMISSION_TRIGGER_ANIMATION permission not set
This doesn't stop the sofa working at all but looks odd and i'm sure will put people off buying it as they might think it's broken.
I'll post the script I use below. Can anyone tell me how I can stop the script error happening?
Many thanks in advance,
Min
//script for sitting cross legged on an object
//by Ananda Sandgrain - free to distribute but please don't sell!
key avatar;
vector pos = <-0.4,-0,0.73>; //adjust the position to fit object -must be
//nonzero in at least one direction or script will not work!
rotation rot = <0.05,0,1,0.05>; //adjust rotation (1 in any vector gives 90 deg)
default
{
state_entry()
{
llSitTarget(pos, rot);
}
changed(integer change)
{
avatar = llAvatarOnSitTarget();
if(change & CHANGED_LINK)
{
if(avatar == NULL_KEY)
{
// You have gotten off
llStopAnimation("sit ground 1"
;llReleaseControls();
llResetScript();
}
else if(avatar == llAvatarOnSitTarget())
{
// You have gotten on
llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION );
}
}
}
run_time_permissions(integer perms)
{
if(perms)
{
llStopAnimation("sit"
;llStartAnimation("sit ground 1"
;}
else
{
llUnSit(avatar);
}
}
}