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
Movement Move up and down on touch  

Move up and down on touch

Moves a prim repeatedly up and down. Stop start via touch

Category: Movement
By : Ferd Frederix
Created: 2013-12-09 Edited: 2013-12-09
Worlds: Second Life

the Zip file

Download all files for Move up and down on touch
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Up and down.lsl

This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1
2 // if you take a -1 and complement it with ~, it become 0, and vice versa. 0 is False, everything else is True
3 integer toggle = -1;
4 integer toggle2 = -1;
5
6
7 // make a function call and send it a direction to move
8 move(vector direction)
9 {
10 integer p = 0;
11 integer n = 10;
12 for (; p < n; ++p) {
13 llSetPos(llGetPos() + direction);
14 }
15 }
16
17 default {
18
19 // I hate states. They are slow to change and memory intensive. We don't even need the default state.
20
21 touch_start(integer total_number)
22 {
23 toggle = ~ toggle; // 0 = -1 = 0 = -1 = 0 and so on
24 if(toggle) // if True, as in not zero
25 llSetTimerEvent(0.2); // 5 times a second
26 else
27 llSetTimerEvent(0); // shit off
28
29 }
30 timer()
31 { toggle2 = ~ toggle2;
32
33 if(toggle2)
34 move(<0,0,0.05>);
35 else
36 move(<0,0,-0.05>);
37 }
38 }

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