1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
local m=1
repeat
m=m+1
toX[id],toY[id]= player(id,"x")-math.sin(math.rad(player(id,"rot")+180))*m, player(id,"y")+math.cos(math.rad(player(id,"rot")+180))*m
until (tile(math.floor(toX[id]/32),math.floor(toY[id]/32),"wall")) or m>=itemtype(player(id,"weapontype"),"range")*3
toX[id], toY[id] = player(id,"x")-math.sin(math.rad(player(id,"rot")+180))*(m-1), player(id,"y")+math.cos(math.rad(player(id,"rot")+180))*(m-1)
xtoX[id], ytoY[id] = toX[id]+math.sin(math.rad(player(id,"rot")+180))*(m-1)/2, toY[id]-math.cos(math.rad(player(id,"rot")+180))*(m-1)/2
Dist= math.sqrt((player(id,"x")-toX[id])^2 + (player(id,"y")-toY[id])^2)
if zb.beam[id]~="" then
freeimage(zb.beam[id])
else
zb.beam[id]=0
end
zb.beam[id]= image("gfx/Zombie Brutality/beam.bmp",xtoX[id],ytoY[id],1)
imagepos(zb.beam[id],xtoX[id],ytoY[id],player(id,"rot")+math.random(-1,1))
imagescale(zb.beam[id],1,Dist)
alP=1
function LocalalP()
alP=alP-0.1
imagealpha(zb.beam[id],alP)
end
timer(5,"LocalalP","",10)