of     1   

darkdog299
#221213302Thursday, July 13, 2017 2:51 PM GMT

I made this thing where if you go close to any player in the game it will make the text of a GUI saying "You are next to (player)", the problem is that it only works for one of the players in the game and everything else just breaks: here's the code: repeat wait() until game.Players.LocalPlayer.Character player = game.Players.LocalPlayer local head = player.Character:WaitForChild("Head") 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 and player.Character and v.Character and head then player.PlayerGui.ScreenGui.TextLabel.Text = "You are standing next to "..v.Name elseif magnitude > 10 and v.Name ~= player.Name and player.Character and v.Character and head then player.PlayerGui.ScreenGui.TextLabel.Text = "You are standing next to nobody" end end end --if you want to get a closer look to try and figure it out I have the uncopylocked place here so you can test with 3 players and see what I mean: https://www.roblox.com/games/914378398/Magnitude-Between-Players
darkdog299
#221213403Thursday, July 13, 2017 2:53 PM GMT

1
darkdog299
#221213612Thursday, July 13, 2017 2:56 PM GMT

2
darkdog299
#221213646Thursday, July 13, 2017 2:57 PM GMT

3
darkdog299
#221213773Thursday, July 13, 2017 3:00 PM GMT

4
BJCarpenter
#221214937Thursday, July 13, 2017 3:25 PM GMT

while true do wait() player.PlayerGui.ScreenGui.TextLabel.Text = "You are standing next to nobody" 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 and player.Character and v.Character and head then player.PlayerGui.ScreenGui.TextLabel.Text = "You are standing next to "..v.Name end end end This will still only pick ONE of the Player within 10 studs. You will have to make more TextLabels, or create another list, and add every close player to that list, then write another loop after this to print out list.

    of     1