There's been a problem.Every single server i visited haves this flashlight script,and i can't find it.Where is it?
Can you please help me?
General
Flashlight script
Flashlight script
1

function array(s,v)
local t = {}
for i = 1, s do
t[i]=v
end
return t
end
map_objects = 0
flashlight_is_on = array(32,false)
function player_flashlight()
for i=1,32,1 do
id=image("gfx/sprites/flashlight.png",1,1,200+i)
if i == 1 then map_objects = id - 1 end
imagecolor(id,255,255,255)
imageblend(id,1)
imagealpha(id,0.5)
imagescale(id,1,1)
flashlight_is_on[id] = false
end
end
player_flashlight()
addhook("startround","player_flashlight")
addhook("serveraction","server_serveraction")
function server_serveraction(id,button)
if (button==1) then
flashlight_is_on[id] = not flashlight_is_on[id]
if flashlight_is_on[id] then
imagealpha(map_objects+id,0.5)
else
imagealpha(map_objects+id,0.0)
end
parse([[sv_sound "flashlight.wav"]])
end
end
1
