I made this script that if there are not atleast five players in the game, this would be in the text..
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(196, 40, 28), Font = Enum.Font.Arial, FontSize = Enum.FontSize.Size24, print("made it here lol") }) wait(10) end end
however, this error pops up https://gyazo.com/548ea005d9c5e636a86935643d556c21
any ideas?
It's simple to resolve your issue. When a game loads the CoreScripts
don't load quick enough (thats what's causing your error). To fix this before ANY of your code in your script put:
wait()
That's all you need to put and it will work fine. The wait()
will wait for all the CoreScripts
/Roblox's Scripts to load.
I hope this helps, don't forget to click Accept Answer
if it worked!
The print function is not to be in the SetCore function.
-- Here's a fix game.StarterGui:SetCore('ChatMakeSystemMessage, { Text = 'Waiting for atleast five players to join'; Color = Color3.new(196/255, 40/255, 28/255); Font = Enum.Font.Arial; FontSize = Enum.FontSize.Size24; })