Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // The most basic of pose scripts
- // change to the name of animation contained within your sittable object
- string pose = "tpose2";
- // change to x,y,z offset of object center where you want to appear (never all 0)
- vector target = <0.0, 0.0, 1.5>;
- integer duration=5;
- key av;
- // optional sit text to appear over object
- // string text = "T-Pose";
- startanimation()
- {
- llStopAnimation("sit");
- llStartAnimation(pose);
- llSetAlpha(0,ALL_SIDES);
- llSetText("",<1.0,0.0,0.0>,1.0);
- }
- stopanimation()
- {
- // llSay(0,"stopping");
- if(av!=NULL_KEY){
- llStopAnimation(pose);
- llStartAnimation("stand");
- }
- llSetAlpha(1,ALL_SIDES);
- llSetText(pose,<1.0,0.0,0.0>,1.0);
- if(av!=NULL_KEY)llUnSit(av);
- }
- default {
- state_entry()
- {
- llSitTarget(target, ZERO_ROTATION);
- av=NULL_KEY;
- pose=llGetInventoryName(INVENTORY_ANIMATION,0);
- llSetSitText(pose);
- stopanimation();
- }
- changed(integer change)
- {
- if (change & CHANGED_LINK)
- {
- if (llAvatarOnSitTarget() != NULL_KEY)
- {
- av=llAvatarOnSitTarget();
- llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
- }
- else
- {
- stopanimation();
- av=NULL_KEY;
- }
- }
- if(change & CHANGED_INVENTORY)
- {
- llResetScript();
- }
- }
- run_time_permissions(integer perm)
- {
- if (perm & PERMISSION_TRIGGER_ANIMATION)
- {
- startanimation();
- // llSay(PUBLIC_CHANNEL, "Animation will end in 5.0 seconds.");
- //llSetTimerEvent(duration);
- }
- }
- timer()
- {
- llSetTimerEvent(0);
- stopanimation();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement