Im interested in putting a server timer in all of my games that will start going up once the game is made. It would be on a SurfaceGui for sure.
Hi guywithapoo,
workspace
that just runs a function to do the count down because it will automatically run once the server starts. So, it would simple be something like this after you have identified the SurfaceGui
text:local startingTime = 30 -- 30 seconds timer local increment = 0.05 -- Will change time by 0.05 seconds local function runTimer() surfaceGuiText.Text = startingTime - increment; end while startingTime > 0 do -- While loop that keeps running until the timer runs out. wait() runTimer() -- Runs the function as soon as the script runs. end
Hopefully, I was of help. Have a nice day/night.
Thanks,
Best regards,
IdealistDeveloper
You could also do this and is more efficient
textlabel=game.Workspace.Part.SurfaceGui.TextLabel -- PATH TO TEXT LABEL HERE textlabel.Text=tostring(math.floor(game.Workspace.DistributedGameTime))