How to Make Raycast Ignore All Players with a Server Sided Script?

Hi all!

Does anyone know how to make a ray from a Raycast ignore all players currently in the game and those that will join later from the server? I want to use FindPartOnRayWithIgnoreList(), even though it is deprecated. I tried making a function that adds all the players characters to a list when they join, but it did not work. Thanks!

1 Like

If you meant by ignoring all player’s characters. Create a table containing all players’ characters, simply by GetPlayers and Character.

Culprits of this issue are two:

  1. Character was nil and CharacterAdded wasn’t fired yet, or vice versa: Character somehow existed before CharacterAdded was fired.
  2. Players respawn every time they die, use CharacterAdded.
3 Likes