-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lsl
65 lines (63 loc) · 1.72 KB
/
main.lsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
float hailRed = 0;
float hailGrn = 1;
float hailBlu = 0;
float hailtimer = 0.1;
string color = "hailsRedUp";
default
{
on_rez(integer start_param)
{
llResetScript();
}
changed(integer change)
{
if (change & CHANGED_OWNER)
llResetScript();
}
state_entry()
{
llSleep(0.7); //sleep for a lil bit <3
llSetTimerEvent(hailtimer);
}
timer()
{
if(color == "hailsRedUp"){
if(hailRed <= 1){
hailRed += 0.05;
}else{
color = "hailsGrnDown";
}
}else if(color == "hailsRedDown"){
if(hailRed >= 0){
hailRed -= 0.05;
}else{
color = "hailsGrnUp";
}
}else if(color == "hailsGrnUp"){
if(hailGrn <= 1){
hailGrn += 0.05;
}else{
color = "hailsBluDown";
}
}else if(color == "hailsGrnDown"){
if(hailGrn>=0){
hailGrn -= 0.05;
}else{
color = "hailsBluUp";
}
}else if(color == "hailsBluUp"){
if(hailBlu<=1){
hailBlu += 0.05;
}else{
color = "hailsRedDown";
}
}else if(color == "hailsBluDown"){
if(hailBlu>=0){
hailBlu -= 0.05;
}else{
color = "hailsRedUp";
}
}
llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, <hailRed, hailGrn, hailBlu>, 1.0]);
}
}