Forum




Check if a player hit the wall !
5 replies



1. Place a

2. Make a map script like so:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
hit_counter = 0 wall_image = 0 wall_x = 1 -- Tile X coordinates of the wall wall_y = 1 -- Tile Y coordinates of the wall addhook("startround_prespawn","s") function s() 	hit_counter = 0 	wall_image = image("<tile:"..tile(wall_x,wall_y,"frame")..">",wall_x*32,wall_y*32,3) 	imagehitzone(wall_image,102,0,0,32,32) 	-- imagehitzone(wall_image,102,-1,-1,34,34) -- if the previous imagehitzone function doesn't quite work end addhook("hitzone","h") function h(iid) 	if iid == wall_image then 		hit_counter = hit_counter + 1 		if hit_counter == 2 then 			parse("triggerposition "..wall_x.." "..wall_y) 			freeimage(wall_image) 			wall_image = 0 		end 	end end
edited 2×, last 09.05.18 12:02:43 am



Although, I got a distinct idea. We'll be about using

So good luck you who is going to deal with it

So you check both angles - the moment the player throws the nade


The problem is that the damage to the wall will be applied when the nade lands; not when it hits the wall!
So its not possible practicaly.
You do know the player´s cursor position while he throws the nade theoreticly and then... good luck with that
Do you need a script for every wall? I dont think so.





