SL : is a screen gui!
Error : PlayerGui is not a valid member of Player? Can someone fix it and repost entire script? Thanks :)
Script made by roblox and edited by me :
local oldMessage = ""
local minPlayers = 2
function teleportAllPlayers()
local target = CFrame.new(workspace.BrickYouTeleportTo.TeleportTarget.Position)
for i, player in ipairs(game.Players:GetChildren()) do
player.Character.Torso.CFrame = target + Vector3.new(0, i * 5, 0)
player.Playing.Value = 1
for _, child in pairs(game.Players:GetChildren())do
child.Team = game.Teams:WaitForChild("Alive");
end
--add an offset of 5 for each character
end
end
function message(message)
if oldMessage ~= message then
oldMessage = message
print(message)
end
end
function playersCurrentlyPlaying()
for i, player in ipairs(game.Players:GetChildren()) do
if player.Playing.Value == 1 then return true end
end
return false
end
game:GetService('Players').PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
character:WaitForChild("Humanoid").Died:connect(function()
player.Playing.Value = 0
end)
end)
local playing = Instance.new("IntValue", player)
playing.Value = 0
playing.Name = "Playing"
end)
while(true) do
wait(2)
for _, localPlayer in pairs(game.Players:GetChildren())do
if #game.Players:GetPlayers() >= minPlayers then
if playersCurrentlyPlaying() then
message("Waiting for the current game to end...")
localPlayer.Player:WaitForChild('PlayerGui').TL.TextLabel.Text = "Waiting for the current game to end..."
else
message("There are enough players for a new game! Teleporting...")
localPlayer.Player:WaitForChild('PlayerGui').TL.TextLabel.Text = "There are enough players for a new game! Teleporting..."
wait(5)
teleportAllPlayers()
end
else
message("Waiting for more players...")
localPlayer.Player:WaitForChild('PlayerGui').TL.TextLabel.Text = "Waiting for more players..."
end
end
end

10 comments
Can you fix it please? I won't be able to help.
Not reposting the entire script when it's not in a codeblock. And chances are, the script is running before the playerGui has loaded in. Use Player:WaitForChild('PlayerGui')
@Ult I did as you say but now it's saying "Player is not a valid member of Player"
What line?
@Ult fixed, can you please repost it! ()
It doesn't say what line I just pressed f9 in game, the script runs perfectly on studio play mode but not in real play mode!
It should still have a line in the developer console.
? ^ whats that mean?
Nevermind. Let me answer it
^ ty