Server Countdown System

I want to make a countdown system, countdown starts when you hit the block and if countdown runs out player will go to the another server and other players can’t join your game when game started on the server.

Like that game’s server thing: Isle - Roblox

How can I do that? Anybody’s have idea?

Well, I would start with a script that shows how long a server has been running. I don’t know scripting so I assume you’d have to add functions to where if you hit the block it activates the timer. You’d have to make it end to your specifics though. I don’t do any scripting so idk how well this would be.

You can use a variable to get the starting time, local startTime = time() - this would be a constant value (this function returns the time at the moment it’s used).
And you can use a while loop to create the countdown,

local startTime = time()
local finishTime = startTime + 30 -- this will define the length of the countdown in seconds
while time() < finishTime do
    print(finishTime-time()) -- this will visualise the countdown
end
<post-countdown functions go here>
1 Like

I tried that on my roblox studio and its not working.

I just edited it a while ago, try it again

Oops I made a mistake, I just edited it again. Try now.

You can also use math.floor() or math.ceil() to get integers