I made a playerlist and I’ve never scripted one before so I’m kind of new to it.
For some reason it works for the first player but not for the next ones as you can see in this video.
https://gyazo.com/767564040ce85c5619c6407b68dd4e7e
Here is my script
game.Players.PlayerAdded:Connect(function(NewPlayer)
local PlayerGui = NewPlayer:WaitForChild("PlayerGui")
local MainGui = PlayerGui:WaitForChild("MainScreenGui")
local MF = MainGui:WaitForChild("AllFrame")
local List = MF:WaitForChild("PlayerMenu")
local There = false
for i,P in pairs(game.Players:GetPlayers()) do
for i,Lab in pairs(P.PlayerGui.MainScreenGui.AllFrame.PlayerMenu:GetChildren()) do
if not game.Players:FindFirstChild(Lab.PlayerName.Text) then
if Lab.PlayerName.Text ~= NewPlayer.Name and not game.Players:FindFirstChild(Lab.PlayerName.Text) then
if There == false then
There = true
Lab.PlayerName.Text = NewPlayer.Name
print("1")
end
else
if Lab.PlayerName.Text ~= P.Name and not game.Players:FindFirstChild(Lab.PlayerName.Text) then
Lab.PlayerName.Text = P.Name
print("2")
end
end
end
end
end
end)