So, I have a repeat loop, and at the end it says "until 2+2==5" Instead of going forever, I want it to go 10,000 times, display a message saying "This server will now shutdown, in case of an update" then shutdown the server. I have a variable at the top saying m = instance.new("Message"), so you can use that at the end. Thanks!
COMMUNITY QUESTION
How to go 10,000 times and then shutdown the server?
1 answer
Above the loop, put local i = 0
Inside the loop, at the top-most level put i = i + 1
At the until line, change 2 + 2 == 5 (which should just be false btw) to i >= 10000
Afterwards, kick all the players and kick any new player that tries to join. I don't remember off the top of my head how to actually shut down the server, though this will do it automatically once ROBLOX realizes the server is empty:
for _, v in ipairs(Game.Players:GetPlayers()) do
v:Kick()
end
Game.Players.PlayerAdded:connect(function(plr)
plr:Kick()
end
2 comments
0
How do I kick all the players?
0
Use the Kick method of Player. I'll edit my answer to give you an example.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Could you show us the entire script?
You want all 700 lines? I didn't think it was really neccessary for this question.
It isn't, anth.