1------[] 2
1 = shooter
2 = victim
[] = wall
Scripts
get player id behind the wall
get player id behind the wall
1

attack hook (or any other hook):
retrieve mousemapxand mousemapy of player 1 with
player
create 2 variables id and distance,
iterate over all living players:local playerlist=player(0,"tableliving") for _,id in pairs(playerlist) do ' insert distance check logic here end
inside the loop calculate the distance of the player position (
player x and y) and mouse position from the first step. You can probably skip player 1 (the one you got the mouse cursor position from)
if the the id variable is still 0 or if the calculated distance is smaller than the value in the distance variable, save the player id and the distance to the variables
at the end of the loop the id variable will contain the id of the closest player to the cursor and the distance variable will contain the distance between that player and the cursor
in the end you can check if the distance is close enough (<= 32 for instance) and then display the ID
DC: vid = 0
addhook("attack", "attack_")
function attack_(sid)
	if player(sid, "weapon") == 32 then
		if player(sid, "rot") == -- its victim position idk how to do it
			vid = -- idk how to get victim id, dont using hit hook
			msg2(sid, "ID: "..vid)
		end
	end
end
math.sqrt((player(sid, "x") - player(vid, "x")) ^ 2 + (player(sid, "y") - player(vid, "y")) ^ 2))
1
