I have this script that runs system messages at different times. If I put it in a local script, each player gets it at a different time, but if I put it in a normal script, it doesn't work at all. Is there anyway to fix this? Here is the script: It gives this error when its in a normal script. https://gyazo.com/bad11f3082d741c6e5fe9290a7b9c740
game.Players.PlayerAdded:connect(function(player)
wait()
while true do
if game.Workspace.PlayerCount.Players.Value <= 5
then
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "Waiting for at least FIVE players to join..",
Color = Color3.new(100, 100, 0),
Font = Enum.Font.SourceSansLight,
FontSize = Enum.FontSize.Size18,
print("made it here lol")
})
wait(10)
end
wait()
if game.Workspace.PlayerCount.Players.Value >= 5
and game.Workspace.game.CanCollide == true
then
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "Welcome to the annual HUNGER GAMES",
Color = Color3.new(100, 0, 0),
Font = Enum.Font.SourceSansLight,
FontSize = Enum.FontSize.Size18,
})
player.TeamColor = BrickColor.new("Forest green")
wait(10)
game.Workspace.game.CanCollide = false
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "If you don't know how to play, read the description!",
Color = Color3.new(0, 100, 0),
Font = Enum.Font.SourceSansLight,
FontSize = Enum.FontSize.Size18,
})
wait(10)
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "Selecting random arena...",
Color = Color3.new(100, 100, 530),
Font = Enum.Font.SourceSansLight,
FontSize = Enum.FontSize.Size18,
})
wait(5)
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "Arena selected. Prepare to enter the game. May the odds be ever in your favor.",
Color = Color3.new(322, 100, 0),
Font = Enum.Font.SourceSansLight,
FontSize = Enum.FontSize.Size18,
})
wait(20)
local Pos = player.Character:GetPrimaryPartCFrame()
player:LoadCharacter()
player.Character:SetPrimaryPartCFrame(Pos)
if player.Character:FindFirstChild("ForceField") then
player.Character["ForceField"]:Destroy()
wait(1)
game.ReplicatedStorage.Remotes.tp:FireServer()
end end
end
end)

3 comments
You shouldn’t be putting print statements inside a table. Line 11, put it under line 12 or line 13.
Also, connect is deprecated, switch to Connect.
this is the errr it gives: https://gyazo.com/bad11f3082d741c6e5fe9290a7b9c740