Forum

> > CS2D > Scripts > making lights
Forums overviewCS2D overview Scripts overviewLog in to reply

English making lights

3 replies
To the start Previous 1 Next To the start

old making lights

XeniTh
User Off Offline

Quote
hi guys, i need help. in a server ive seen players CREATING lights... like the flashlight but when i type '!placelight' the light appears and it does not move around... it does not move when i move and it does not rotate... can someone make me that script? but pls dont make it buggy because i hate when players make 100 lights and destroy my server... only 1 light per player... i dont know how to make a script.. so pls help me. thanks.

old Re: making lights

EngiN33R
Moderator Off Offline

Quote
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
function initArray2(f,v)
local cmd={}
for c=1,f do
cmd[c]=v
end
return cmd
end

light=initArray2(32,0)

addhook("serveraction","pootlightheer")
function pootlightheer(id,a)
if (a==1) then --1 is F2, 2 is F3 and 3 is F4, change to whatever pleases you
if (light[id]==0) then
light[id]=image("gfx/sprites/flare3.bmp",player(id,"x"),player(id,"y"),1)
imageblend(light[id],1)
end
end
end

addhook("die","killlight")
function killlight(id)
freeimage(light[id])
light[id]=0
end
That should do it.

old thanks!

XeniTh
User Off Offline

Quote
engineer, BIG thanks for this!!! it worked!
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview