|
Aki Clutterbuck
Registered User
Join date: 30 Mar 2006
Posts: 5
|
07-02-2006 11:38
Hello, I'm still learning how to script (mostly just tweaking existing scripts) and am wondering if there is a script that has the following:
allows you to sit on an object and animates you for a certain period of time and then kicks you off the item?
any help is appreciated.
Aki
|
|
Dr Drebin
Registered User
Join date: 19 Mar 2006
Posts: 66
|
07-02-2006 15:17
You could put it in a temp rezzor and get bumped off every 2 minutes or so. (the time can be adjusted).
The makers of psiTEC has (or had) a free one on SLexchange. (Alberon Industries? Aberon? I can't recall exactly.)
|
|
Thili Playfair
Registered User
Join date: 18 Aug 2004
Posts: 2,417
|
07-02-2006 15:38
one i use now and then, string anim = "anim"; vector sit_pos = <0,0,0.001>; vector sit_rot = <0,0,0>; integer perms = PERMISSION_TRIGGER_ANIMATION; key user; default { state_entry() { llSitTarget(sit_pos, llEuler2Rot(sit_rot * DEG_TO_RAD)); } changed(integer change) { if (change & CHANGED_LINK) { llSleep(0.01);//i'm not sure if a sleep is actualy needed. but i'll leave it key sit = llAvatarOnSitTarget(); integer u = ((llGetAgentSize(user) != ZERO_VECTOR) && (llGetPermissions() & perms) == perms); if(sit == NULL_KEY) { user = NULL_KEY; if(u) llStopAnimation(anim); } else if(!u) llRequestPermissions(sit, perms); } } run_time_permissions(integer perm) { key sit = llAvatarOnSitTarget(); if((perm&perms) != perms || llGetAgentSize(sit) == ZERO_VECTOR || sit!=llGetPermissionsKey()) { user = NULL_KEY; return; } user = sit; llStopAnimation("sit"); llStartAnimation(anim); } } you could put a timer in there when someone sit on it, and unsit them when it reaches that,
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
07-02-2006 16:05
use a timer that starts when they sit, (be sure to cycle it off then on when they sit) and then call unsit on them. Something like string anim = "walk"; key user; vector sit_pos = <0.0,0.0, 0.1>; vector sit_rot;//in degrees ^_^
default { state_entry() { llSitTarget(sit_pos, llEuler2Rot(sit_rot * DEG_TO_RAD)); } changed(integer a) { if(a & CHANGED_LINK) { key b = llAvatarOnSitTarget(); if(b)//this returns true, if 1) it's a valid key and 2) if it's not NULL_KEY { user = b; if(user != llGetPermissionsKey()) llRequestPermissions(user, PERMISSION_TRIGGER_ANIMATION); else if(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) llStartAnimation(anim);//doesn't hurt. } else if(llGetAgentSize(user)) { if((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) && (user == llGetPermissionsKey())) llStopAnimation(anim);//they are in the sim, & we have permissions. llResetScript(); } } } run_time_permissions(integer a) { if(a & PERMISSION_TRIGGER_ANIMATION) llStartAnimation(anim); llSetTimerEvent(0.0); llSetTimerEvent(300.0);//5 min } timer() { llUnSit(user); llSetTimerEvent(0.0); } }
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|