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
count = {}
dir = {}
for i = 1, 32 do
count[i]=0
dir[i] = 0
end
addhook("hit","hit")
function hit(id,od)
	if (player(id,"team") == 1) and (player(od,"team") == 2) then
		dir[id] = player(od,"rot")
		count[id] = 3
	end
end
function getpos(x, y, dir, speed)
	return x + math.sin(math.rad(dir)) * speed, y + -math.cos(math.rad(dir)) * speed
end
addhook("always","always")
function always()
for id = 1,32 do
	if player(id,"exists") then
		if player(id,"health")>0 and count[id] > 0 then
			local x, y = getpos(player(id,"x"), player(id,"y"), dir[id], 26)
			if tile(math.floor(x/32), math.floor(y/32),"walkable") then
				x, y = getpos(player(id,"x"), player(id,"y"), dir[id], 10)
				parse("setpos "..id.." "..x.." "..y)
				count[id] = count[id] - 1
			else
				count[id] = 0
			end
		end
	end
end
end