JulieAnne Rau Posted March 20, 2020 Share Posted March 20, 2020 So have this script that works great for a rope climb but I want to make it group only... I know it has something to do with this.. if ( llSameGroup( llDetectedKey(0) ) ) but I'm not sure where it fits in the script, can someone give me a kick in the pants and get me going? ------------------------------------------------------------ float LADDERHEIGHT= 6.0; // how far to move up float STEPHEIGHT = 0.25; // how far to move each step float OFFSET = 0; // tilt float Extra = -2; // extra move onto the roof climbup() { llSetAlpha(0,ALL_SIDES); llStopAnimation("sit"); llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0)); integer i; vector original; float steps = LADDERHEIGHT / STEPHEIGHT; float offset = OFFSET / steps; // to one side original = llGetPos(); do { i++; vector newPos = llGetPos() + <offset,0, STEPHEIGHT> * llGetRot(); llSetPos(newPos); } while(i <= (steps)); llSetPos(llGetPos() + <Extra, 0, 0> * llGetRot()); // extra, then unsit llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION,0)); if(llAvatarOnSitTarget() != NULL_KEY) { // somebody is sitting on me llUnSit(llAvatarOnSitTarget()); // unsit him or her } llSetRegionPos(original); llSetAlpha(1,ALL_SIDES); } // end climbup default { state_entry() { llSitTarget(<0.50, 0.0, 0.1>, ZERO_ROTATION); } changed(integer change) { if(change == CHANGED_LINK) { key avatar = llAvatarOnSitTarget(); if(avatar != NULL_KEY) { llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION); climbup(); } } } //end changed } //end default Link to comment Share on other sites More sharing options...
Rolig Loon Posted March 20, 2020 Share Posted March 20, 2020 (edited) That's not all that's missing. Your script is missing an entire event: float LADDERHEIGHT= 6.0; // how far to move up float STEPHEIGHT = 0.25; // how far to move each step float OFFSET = 0; // tilt float Extra = -2; // extra move onto the roof climbup() { llSetAlpha(0,ALL_SIDES); llStopAnimation("sit"); llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0)); integer i; vector original; float steps = LADDERHEIGHT / STEPHEIGHT; float offset = OFFSET / steps; // to one side original = llGetPos(); do { i++; vector newPos = llGetPos() + <offset,0, STEPHEIGHT> * llGetRot(); llSetPos(newPos); } while(i <= (steps)); llSetPos(llGetPos() + <Extra, 0, 0> * llGetRot()); // extra, then unsit llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION,0)); if(llAvatarOnSitTarget() != NULL_KEY) { // somebody is sitting on me llUnSit(llAvatarOnSitTarget()); // unsit him or her } llSetRegionPos(original); llSetAlpha(1,ALL_SIDES); } // end climbup default { state_entry() { llSitTarget(<0.50, 0.0, 0.1>, ZERO_ROTATION); } changed(integer change) { if(change == CHANGED_LINK) { key avatar = llAvatarOnSitTarget(); if(avatar != NULL_KEY) { if ( llSameGroup(avatar) ) { if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) { climbup(); } else { llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION); } } } } } //end changed run_time_permissions (integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { climbup(); } } // end run_time_permissions } //end default Edited March 20, 2020 by Rolig Loon Ooops Link to comment Share on other sites More sharing options...
JulieAnne Rau Posted March 20, 2020 Author Share Posted March 20, 2020 thanks, not sure how I missed that. Anyone got any ideas on how to make it group only? best Regards, Julie Link to comment Share on other sites More sharing options...
Rolig Loon Posted March 20, 2020 Share Posted March 20, 2020 I already did that. 😎 Link to comment Share on other sites More sharing options...
JulieAnne Rau Posted March 20, 2020 Author Share Posted March 20, 2020 When I copy and paste, I'm getting a run error at run_time_permissions (integer perm) not sure why that is? Link to comment Share on other sites More sharing options...
JulieAnne Rau Posted March 20, 2020 Author Share Posted March 20, 2020 ok, figured it out, its just a bracket missing... your awesome.. I tested it out and it works great. thank you so much. I must have been having a blondie moment and typed before I looked. Thanks again. 2 Link to comment Share on other sites More sharing options...
Rolig Loon Posted March 20, 2020 Share Posted March 20, 2020 56 minutes ago, JulieAnne Rau said: ok, figured it out, its just a bracket missing... Uh-oh. That was my fault. Rookie mistake. 🙄 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now