local amountOfPlayers = game.Players.NumPlayers while true do if amountOfPlayers >= 2 then game.Workspace.Lobby.Teleporters.TeleporterA.Teleporter1.Script.Disabled = false --turns the teleporter off print("Enough Players") print(amountOfPlayers) wait(10) else game.Workspace.Lobby.Teleporters.TeleporterA.Teleporter1.Script.Disabled = true --turns teleporter on print("Not Enough Players") print(amountOfPlayers) wait(10) end end
I am making a game with 3 teleporters and I want it so when there is 2 or more players the teleporters will be enabled. When I run the game by myself I get not enough players like a should but it also prints 0. It does the same with 2 players.
"amountOfPlayers" will always be whatever the value first assigned to it is. Try putting it inside of your loop, or change the value of it using the .PlayerAdded event.