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
Touch Delayed_touch_without_timer_event  

Delayed_touch_without_timer_event

Instead of llSetTimerEvent() we use llGetTime().
It is refreshed continuously while the object is clicked and doesn't need to be cleaned like a timer afterwards.

Category: Touch
By : aria.dragonash
Created: 2010-09-08 Edited: 2010-09-08
Worlds: Second Life

the Zip file

Download all files for Delayed_touch_without_timer_event
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Delayed_touch_without_timer_event_1.lsl
1 float delay=1.0; // how long the mousebutton must be held down to perform action
2 integer active;
3
4 default
5 {
6 touch_start(integer num_detected)
7 {
9 active=FALSE;
10 }
11
12 touch (integer num_detected)
13 {
14 float time=llGetTime();
15 if(time>=delay && !active)
16 {
17 llSay(0,"Do something cool here.");
18 active=TRUE;
19 }
20 }
21 }

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