Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ~pose1
- //MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License)
- integer ch = 0; //pose1: ch=0 //pose2: ch=1
- string animation = "stand";
- key avatar;
- stopAnim() {
- list l=llGetAnimationList(llGetPermissionsKey());
- integer i;
- for (i;i<llGetListLength(l);++i) llStopAnimation(llList2String(l,i));
- }
- default {
- state_entry() {
- ch += (integer)("0x"+llGetSubString((string)llGetKey(),-4,-1)); //fixed channel for prim
- llListen(ch+4,"",NULL_KEY,"");
- }
- link_message(integer from, integer num, string an, key id) { //an animation is set
- if (an == "PRIMTOUCH") {
- return;
- }
- if(num != ch) return;
- if (llGetPermissionsKey() == avatar && avatar != NULL_KEY) { //permissions
- llStopAnimation(animation);
- llStartAnimation(an);
- }
- animation=an;
- }
- listen(integer channel, string name, key id, string str) {
- if (str == "ALIVE" || str == "DIE") {
- llMessageLinked(LINK_THIS,2,str,""); //send msg from ball to menu
- return;
- }
- avatar = str; //avatar sits or stands up
- if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) { //permissions ok
- stopAnim();
- if (llGetPermissionsKey() == avatar) { llStartAnimation(animation); return; } //if avatar is the same: animate
- }
- if (avatar != NULL_KEY) llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION); //ask permission from new avatar
- }
- run_time_permissions(integer perm) {
- if (perm & PERMISSION_TRIGGER_ANIMATION && llGetPermissionsKey() == avatar) { //avatar gave permission
- stopAnim();
- llStartAnimation(animation);
- }
- }
- }
Add Comment
Please, Sign In to add comment