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 Advanced_Movement_Lock  

Advanced_Movement_Lock

Stop people from pushing you around

Category: Defense
By : Davy Maltz
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Advanced_Movement_Lock
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Advanced_Movement_Lock_1.lsl
1 integer locked;
2 integer mode;
3 default
4 {
6 {
7 locked = (integer)llGetObjectDesc();
8 llListen(0,"",llGetOwner(),"");
9 if(llGetObjectDesc() == "on")
10 {
11 state on;
12 }
13 }
14 listen(integer channel, string name, key id, string message)
15 {
16 if(message == ".lon")
17 {
18 llSetObjectDesc("on");
19 state on;
20 }
21 }
22 }
23
24 state on
25 {
26 on_rez(integer start_param)
27 {
29 }
31 {
32 mode = (integer)llGetObjectDesc();
34 llListen(0,"",llGetOwner(),"");
35 }
36 listen(integer channel, string name, key id, string message)
37 {
38 if(message == ".loff")
39 {
41 llSetObjectDesc("off");
42 state default;
43 }
44 }
45 collision_start(integer num_detected)
46 {
47 if(locked == 1)
48 {
51 }
52 }
54 {
55 if(perm)
56 {
58 locked = 1;
59 llMoveToTarget(llGetPos(),0.05);
60 }
61 }
62 control(key id, integer levels, integer edge)
63 {
64 if(llGetAgentInfo(llGetOwner()) != (AGENT_FLYING|AGENT_IN_AIR))
65 {
66 if(((levels & CONTROL_FWD) == CONTROL_FWD))
67 {
68 locked = 0;
70 }
71 else if( ((levels & CONTROL_RIGHT) == CONTROL_RIGHT))
72 {
73 locked = 0;
75 }
76 else if( ((levels & CONTROL_UP) == CONTROL_UP))
77 {
78 locked = 0;
80 llSleep(4);
81 }
82 else if( ((levels & CONTROL_DOWN) == CONTROL_DOWN))
83 {
84 locked = 0;
86 }
87 else if( ((levels & CONTROL_FWD) == CONTROL_FWD))
88 {
89 locked = 0;
91 }
92 else if( ((levels & CONTROL_BACK) == CONTROL_BACK))
93 {
94 locked = 0;
96 }
97 else
98 {
99 locked = 1;
100 llMoveToTarget(llGetPos(),0.05);
101 }
102 }
103 }
104 }

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