Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Defense AntiPush  

AntiPush

Anti-Push.lsl

Category: Defense
By : Sapphire Bombay
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for AntiPush
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. AntiPush_1.lsl
1
2 // AntiPush Script V1.0
3 // Created 11/17/2003 by Sapphire Bombay
4 // Last Updated 11/17/2003
5 // Concept adapted from Huns Valen
6 // Freely donated to the public domain
7
8 integer locked; // TRUE if avatar is damping to current position
9 float LOCKWAIT = 1.0; // if you don't move for this period of time, you lock into place
10
11 default
12 {
14 {
15 }
16
17 // request controls & prime locked condition
18 on_rez(integer start_param)
19 {
21 locked = FALSE;
22 }
23
24 // if user accepts, trap control events and also allow them to pass on to the avatar for movement:
25 //
26 // llTakeControls(integer controls, integer accept, integer pass_on);
27 //
28 // If (accept == (controls & input)), send input to object. If the boolean pass_on is TRUE, also send input to avatar.
29
31 {
33 {
42 TRUE, TRUE);
43 // set timer to periodically check the time since the last control input
45 }
46 }
47
48 // called any time a user moves. release the damping if the avatar is locked. reset the time since last movement.
49 control(key id, integer level, integer edge)
50 {
51 if(locked)
52 {
54 locked = FALSE;
55 //llWhisper(0, "unlocked");
56 }
58 }
59
60 // if the avatar is not already locked and it has been longer than the wait time since the last movement then lock the avatar
61 timer()
62 {
63 if((!locked) && (llGetTime() > LOCKWAIT))
64 {
66 locked = TRUE;
67 //llWhisper(0, "locked");
68 }
69 }
70 }
71 // END //

Back to the Best Free Tools in Second Life and OpenSim.