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
Light light_script  

light_script

touchable on/off lamp that casts shadows. You can have up to 4 in view at a time ( SL restriction as moon, + sun + 4 lights is a a max of 6)

Category: Light
By : Ferd Frederix
Created: 2010-01-10 Edited: 2014-09-07
Worlds: Second Life

the Zip file

Download all files for light_script
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. light_script_1.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 // Touch the object to light it up.
3 // Lighting is configurable.
4
5 integer light_s = FALSE;
6 vector lightcolor = <1.0, 0.75, 0.5>;
7 float intensity = 1.0; // 0.0 <= intensity <= 1.0
8 float radius = 10.0; // 0.1 <= radius <= 20.0
9 float falloff = 0.01; // 0.01 <= falloff <= 2.0
10 float glow = 0.05;
11
12 toggle()
13 {
14 float thisglow = 0.0;
15 light_s = !light_s;
16
17 if(light_s)
18 thisglow = glow;
19
21 PRIM_POINT_LIGHT, light_s, lightcolor, intensity, radius, falloff,
22 PRIM_FULLBRIGHT, ALL_SIDES, light_s,
23 PRIM_GLOW, ALL_SIDES, thisglow
24 ]);
25 llSetColor(lightcolor, ALL_SIDES);
26 }
27
28 default
29 {
31 {
32 llSetText("Touch for light", <1.0, 1.0, 1.0>, 1.0);
33 toggle();
34 }
35
36 touch_start(integer total_number)
37 {
38 toggle();
39 }
40
41 changed(integer what)
42 {
43 if(what & CHANGED_REGION_RESTART)
44 {
46 }
47 }
48 }
49
50 // END //

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