How can I fix this script to work so that say it waits 10 seconds and there is only 1 player in the server and it couldn't find another person to be a king. How can I make it insert a message and announce "Error: Not enough players. Restarting..."?
local list = game.Players:GetChildren() f = list[math.random(1, #list)] repeat wait(0.5) b = list[math.random(1, #list)] print(b.Name .. ", " .. f.Name) until f.TeamColor ~= b.TeamColor

2 comments
I already have something similar to that in another script. But I need it to check just in case otherwise it would just keep checking for 2 diff teams and not work.
You can do a lobby script, when there are enough player to start the game then the game will select randomly a player and put it into the King Team =)