aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin/assets/ScriptsAssetSet/KanEd-Test12.lsl
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-01-12 18:00:46 +0000
committerJustin Clarke Casey2009-01-12 18:00:46 +0000
commitfb8faa8336ddb795ccd6840259b06a2608350a57 (patch)
tree1f4977b9918d416602af88709e15aecf9499b969 /bin/assets/ScriptsAssetSet/KanEd-Test12.lsl
parent* Remove FunSLUDP code since this has moved to http://forge.opensimulator.org... (diff)
downloadopensim-SC-fb8faa8336ddb795ccd6840259b06a2608350a57.zip
opensim-SC-fb8faa8336ddb795ccd6840259b06a2608350a57.tar.gz
opensim-SC-fb8faa8336ddb795ccd6840259b06a2608350a57.tar.bz2
opensim-SC-fb8faa8336ddb795ccd6840259b06a2608350a57.tar.xz
* Apply http://opensimulator.org/mantis/view.php?id=2913
* Add the KanEd scripts to the standard library * Thanks Fly-Man-
Diffstat (limited to 'bin/assets/ScriptsAssetSet/KanEd-Test12.lsl')
-rw-r--r--bin/assets/ScriptsAssetSet/KanEd-Test12.lsl46
1 files changed, 46 insertions, 0 deletions
diff --git a/bin/assets/ScriptsAssetSet/KanEd-Test12.lsl b/bin/assets/ScriptsAssetSet/KanEd-Test12.lsl
new file mode 100644
index 0000000..eaa885b
--- /dev/null
+++ b/bin/assets/ScriptsAssetSet/KanEd-Test12.lsl
@@ -0,0 +1,46 @@
1vector startPosition;
2float groundLevel;
3
4default
5{
6 state_entry()
7 {
8 // get permission to take over the avatar's control inputs.
9 llRequestPermissions( llGetOwner(), PERMISSION_TAKE_CONTROLS );
10
11 startPosition = llGetPos();
12 groundLevel = llGround( startPosition );
13 }
14
15 run_time_permissions( integer perm ) // event for processing
16 // permission dialog.
17 {
18 if ( perm & PERMISSION_TAKE_CONTROLS ) // permission has been given.
19 {
20 // go ahead and take over the forward and backward controls.
21 llTakeControls( CONTROL_FWD | CONTROL_BACK, TRUE, FALSE );
22 }
23 }
24
25 control( key id, integer held, integer change ) // event for processing
26 // key press.
27 {
28 vector position = llGetPos();
29
30 if ( change & held & CONTROL_FWD )
31 { // the "move forward" control has been activated.
32 if( position.z < (startPosition.z + 10.0) )
33 {
34 llSetPos( llGetPos() + < 0, 0, 1.0 >); // move up
35 }
36 }
37 else if ( change & held & CONTROL_BACK )
38 { // the "move backward" key has been activated.
39 if( position.z > groundLevel + 1.0 )
40 {
41 llSetPos( llGetPos() + < 0, 0, -1.0 >); // move down
42 }
43 }
44 }
45}
46