-
Notifications
You must be signed in to change notification settings - Fork 0
/
rainbow_props.txt
109 lines (104 loc) · 2.53 KB
/
rainbow_props.txt
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
@name RainbowProps
@inputs Prop:entity
@persist [PropTable]:gtable [ArrayIndex,LoopCounter,Reset,Timer] [Color]:vector [ColorArray,TempColors]:array
if(first()){
Timer=1000
Reset=48
ColorArray=array(
vec(255,0,0),
vec(255,32,0),
vec(255,64,0),
vec(255,96,0),
vec(255,128,0),
vec(255,160,0),
vec(255,192,0),
vec(255,224,0),
vec(255,255,0),
vec(224,255,0),
vec(192,255,0),
vec(160,255,0),
vec(128,255,0),
vec(96,255,0),
vec(64,255,0),
vec(32,255,0),
vec(0,255,0),
vec(0,255,32),
vec(0,255,64),
vec(0,255,96),
vec(0,255,128),
vec(0,255,160),
vec(0,255,192),
vec(0,255,224),
vec(0,255,255),
vec(0,224,255),
vec(0,192,255),
vec(0,160,255),
vec(0,128,255),
vec(0,96,255),
vec(0,64,255),
vec(0,32,255),
vec(0,0,255),
vec(32,0,255),
vec(64,0,255),
vec(96,0,255),
vec(128,0,255),
vec(160,0,255),
vec(192,0,255),
vec(224,0,255),
vec(255,0,255),
vec(255,0,224),
vec(255,0,192),
vec(255,0,160),
vec(255,0,124),
vec(255,0,96),
vec(255,0,64),
vec(255,0,32)
)
TempColors=array():add(ColorArray)
PropTable=gTable(owner():steamID()+"s prop table",1)
if(PropTable["props",array]:count()>0){
Color=TempColors:popVector()
timer("change",Timer)
}else{
PropTable["props",array]=array()
}
}
if(~Prop & ->Prop){
Invert=invert(PropTable["props",array])
if(Invert[Prop:toString(),number]>0){
PropTable["props",array]:remove(Invert[Prop:toString(),number])
Prop:setColor(vec(255))
}else{
PropTable["props",array]:pushEntity(Prop)
if(PropTable["props",array]:count()<2){
Color=TempColors:popVector()
timer("change",Timer)
}
}
}
if(clk("change")){
if(ArrayIndex<=PropTable["props",array]:count()){
while(perf(90) & ArrayIndex<=PropTable["props",array]:count()){
Prop=PropTable["props",array][ArrayIndex,entity]
if(Prop!= noentity()){
Prop:setColor(Color)
}
ArrayIndex++
}
timer("change",0)
}else{
if(TempColors:count()>0){
Color=TempColors:popVector()
}else{
TempColors=array():add(ColorArray)
Color=TempColors:popVector()
}
ArrayIndex=0
LoopCounter++
#setName("Loop Counter: "+LoopCounter)
if(LoopCounter-1==Reset){
reset()
}
timer("change",Timer)
}
}