How do you get all the players that are farther away than 100 studs than the local player
✓ ANSWER ACCEPTED
how do you get player farther away than 100 studs?
1 answer
✓ Accepted answer
Magnitude
Using magnitude can allow you to get the distance from any two parts in studs. You can use magnitude in your case like this: Loop through all valid players like so:
For indexPlayer, Player in pairs (game.Players:GetPlayers()) do
--do stuff
end
Then within the loop you can use magnitude like so:
if (Character.HumanoidRootPart.Position - Player.Character:WaitForChild( "HumanoidRootPart").Position).Magnitude >100 then
--do stuff
end
Sorry about indenting, I did this directly on scripting helpers.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thank you so much