-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwitch_glow.nut
29 lines (26 loc) · 959 Bytes
/
witch_glow.nut
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
local timer = SpawnEntityFromTable("logic_timer",{RefireTime = 0.01})
timer.ValidateScriptScope()
timer.GetScriptScope()["scope"] <- this
timer.GetScriptScope()["func"] <- function(){
scope.WitchGlow_OnTick()
}
timer.ConnectOutput("OnTimer", "func")
EntFire("!self","Enable",null,0,timer)
local glowColor = Vector(255, 255, 255)
local hasLeftSaferoom = false
local function ConvertVectorToInt(vector){
local color = vector.x
color += 256 * vector.y
color += 65536 * vector.z
return color
}
function WitchGlow_OnTick(){
local witch = null
while(witch = Entities.FindByClassname(witch, "witch")){
if(NetProps.GetPropInt(witch, "m_Glow.m_iGlowType") != 3){
NetProps.SetPropInt(witch, "m_Glow.m_iGlowType", 3)
NetProps.SetPropInt(witch, "m_Glow.m_nGlowRange", 99999999)
NetProps.SetPropInt(witch, "m_Glow.m_glowColorOverride", ConvertVectorToInt(glowColor))
}
}
}