I want to make a script where there has to be more than 2 players in a server in order for the next function to work. Here is what I wrote:
function checkPlayers() while wait(5) do for i, v in pairs(game.Players:GetChildren()) do if v:IsA('Player') then print('1') if v >= 2 then script.Value.Value = 1 minigames() else print('2') game.StarterGui.ScreenGui.TextLabel.Text = 'You need atleast 2 or more players in order to start any minigames.' script.Value.Value = 0 end end end end end
It errors at the 6th line, but I don't know how to fix it. I can't find a method to use, if anyone could help that would be nice. :)