0 views0 copies0 likes

Server Round Clock with Intermissions

Universal script

Copy it, then test it in your own Studio place.

Utilities Verified

Script code

12 lines ยท 0.4 KB
Download
local phases = {	{name = "Intermission", duration = 12},	{name = "Round", duration = 60},}while true do	for _, phase in phases do		local deadline = workspace:GetServerTimeNow() + phase.duration		workspace:SetAttribute("RoundEndsAt", deadline)		workspace:SetAttribute("RoundState", phase.name)		repeat task.wait(0.2) until workspace:GetServerTimeNow() >= deadline	endend

About this script

Add this server Script to start a 12-second intermission followed by a 60-second round. RoundState and RoundEndsAt appear as Workspace attributes for UI and spawn scripts to consume. A deadline from GetServerTimeNow lets clients calculate a consistent display without sending a remote event every second. Start a two-client test and confirm that a late arrival sees the same phase.

Comments

Share what works, ask questions, or report an issue.

0

Log in to leave a comment.

No comments yet

Be the first to share your thoughts!

Raw Luau source

local phases = {
	{name = "Intermission", duration = 12},
	{name = "Round", duration = 60},
}
while true do
	for _, phase in phases do
		local deadline = workspace:GetServerTimeNow() + phase.duration
		workspace:SetAttribute("RoundEndsAt", deadline)
		workspace:SetAttribute("RoundState", phase.name)
		repeat task.wait(0.2) until workspace:GetServerTimeNow() >= deadline
	end
end