if there is less than 2 players how would i stop the script from running until there is enough.
game.Players.PlayerAdded:connect(function() if game.Players.NumPlayers < 2 then mm = Instance.new("Message",Workspace) mm.Text = "Not enough players" wait(1) mm:Remove() else if game.Players.NumPlayers >= 2 then mmm = Instance.new("Message",Workspace) mmm.Text = "enough players" wait(1) mmm:Remove() script:Remove() end end -- around here m = Instance.new("Message",Workspace) m.Text = "You are Chosen" wait(5) m:Remove() players = game.Players:GetPlayers() killer = players[math.random(1,#players)] print("You are chosen") end)
Use repeat. The following code waits until the given amount of players are there.
repeat wait() until game.Players.NumPlayers > 2