Over here, a GUI should pop up only visible by you nobody else (that goes for everyone else) whenever you get close to another player in the game. The problem is, it loops through all the players and just picks one for some reason. How can I make it so it works for all players? Heres my code. Help would be greatly appreciated :)
Edit: It works fine with the print function, just shows the GUI for one of the players which is weird
while true do
wait()
for i, v in pairs(game.Players:GetPlayers())do
local magnitude = (player.Character.Head.Position - v.Character.Head.Position).magnitude
if magnitude < 10 and v.Name ~= player.Name then
print("You are next to ")..v.Name
billboard.Enabled = true
else
billboard.Enabled = false
end
end
end
If you can't figure it out I have an uncopylocked place that includes the same thing, if you have time, please look at it [https://www.roblox.com/games/914378398/Magnitude-Between-Players]

4 comments
Line 6; Didn't you mean "String" .. v.Name? :p
What do you mean "it just picks one for some reason"? Is it printing at all?
Thing is, it prints fine whenever I go next to any player in the game it says "you are next to(player)" but the billboard GUI only pops up for one of the players in the game which is strange
You can take a look at the uncopylocked place I made that has the same principle, test it with three players and you'll see the problem :(