Check if another part is visible to another part on the server side?

I am working on some sort of anti cheat and i wanna see if a player can even see another player when shooting the player, For instance if a player is using silent aim they usually would kill the player behind a wall.

This post might help you, however I don’t know if it will work with a player behind a wall.

I tried to use the player’s name display, but it also shows through a wall.

1 Like

You could just raycast from the player’s character to the target, however that are a lot of downsides to this:

Let’s say, the target peeks, the player shoots a perfect shot, but since the player has bad ping and the target took cover again by the time that information reaches the server it would be impossible in the server’s perspective for the player to hit the target causing what was a perfect shot on the player’s screen to simply not damage the target.


Here’s what I recommend, it has only a few extra steps.

Make the player send his position and the target position currently on his screen to the server, then on the server, using a magnitude check compare those positions sent by the player and check if they are not too far off from the positions on the server, then raycast using the client positions, this also makes it harder for exploiters to abuse damage remotes as they have more arguments to figure out the meaning of.

Hope this helps!

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.