nothing is working, only prints 'whats wrong?' in the output...
running = false enough = game.Players.NumPlayers if (running == false and enough >= 1) then running = true while true do m = Instance.new("Message", Workspace) m.Text = "Now starting a new game!" wait(1) m:Destroy() for i, v in pairs(game.Players:GetChildren()) do if v.Character.BoolValue.Value == true then print(v.Name .. " has been found") v.Character.Torso.CFrame = Vector3.new(10,10,10) end end end else print("whats wrong?") running = false end
"Most likely the script loads before game.Players.NumPlayers changes to 1 because the server is started and scripts are run before the client is connected to it." - 1Waffle1
game.Players.PlayerAdded:connect(function(plr) if (running == false and enough >= game.Players.NumPlayers) then --etc.
This will let it check every time a player joins to see if there are enough players.
Most likely the script loads before game.Players.NumPlayers changes to 1 because the server is started and scripts are run before the client is connected to it.
Yeah, the script loads before NumPlayers is updated with 1 as it's value. Try asking if enough is greater than (not greater than or equal to) 0. However, you should put that into a looped wait with that set as the condition if you want it to wait until there are enough players.