Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Poseball & Furniture script
- // by Daemonika Nightfire (2009/2010)
- // NO License! that script is free for all.
- // why poseball and Furniture?...
- // ...just delete all funktions with show/hide and it works for Furniture too.
- // llSitTarget(<-0.1,0.1,-0.43>... set the Avatar Position to the prim in meters,
- // ...,llEuler2Rot(<00,-90,-90>*DEG_TO_RAD)); set the angle Rotation from the Avatar in 3 axis <x,y,z>.
- // why no script error at crashing Avatar?...
- // ...llKey2Name ask for sitting Avatarname...
- // ...is there no name, so nobody there for stop animation and the script will show the Ball only.
- string anim;
- integer sitting;
- show()
- {
- llSetPrimitiveParams([PRIM_TEXT,"SIT HERE",<0.9,0.6,0.2>,1.0, PRIM_COLOR, ALL_SIDES,<1,1,1>,1.0]);
- }
- hide()
- {
- llSetPrimitiveParams([PRIM_TEXT,"",ZERO_VECTOR,0.0, PRIM_COLOR, ALL_SIDES,ZERO_VECTOR,0.0]);
- }
- default
- {
- state_entry()
- {
- show();
- sitting = 0;
- anim = llGetInventoryName(INVENTORY_ANIMATION, 0);
- llSitTarget(<-0.1,0.1,-0.43>,llEuler2Rot(<00,-90,-90>*DEG_TO_RAD));
- }
- run_time_permissions(integer perm)
- {
- if (perm & PERMISSION_TRIGGER_ANIMATION)
- {
- sitting = 1;
- llStopAnimation("sit_generic");
- llStopAnimation("sit");
- llStartAnimation(anim);
- llSetTimerEvent(5.0);
- hide();
- }
- }
- changed(integer change)
- {
- if (change & CHANGED_LINK)
- {
- key avatar = llAvatarOnSitTarget();
- if (llKey2Name(avatar) != "")
- {
- llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);
- }
- else
- {
- show();
- if ((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) && sitting && llKey2Name(avatar) != "")
- {
- llStopAnimation(anim);
- }
- sitting = 0;
- }
- }
- if (change & CHANGED_OWNER + CHANGED_REGION_START + CHANGED_INVENTORY)
- {
- llResetScript();
- }
- }
- on_rez(integer start_param)
- {
- llResetScript();
- }
- }
- timer()
- {
- llSetTimerEvent(0.0);
- llStopAnimation("sit");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement