I've been trying to make a minigame kit for me and other people to use, and I thought it would be a good way to practice scripting since I'm a beginner. I've gotten down the times (like how long each round lasts, and intermission) and what I'm working on now is the count down GUI.
-- K E Y ~ [CE: Can edit] - [DE: Don't edit] - [CD: Can delete]
--[Starter Variables]
local MaxRoundTimeInSeconds = 10 --The maximum round time (in seconds) until intermission. [CE]
local IntermissionTimeInSeconds = 5 -- The intermission time (in seconds) until round begins. [CE]
local RoundStartTime -- Is set depending on when the round begins. [DE]
local IntermissionStartTime -- Is set depending on when the intermission begins. [DE]
--[Function that defines the beginning of the round]
local function initialize() -- Function name "initialize" to represent beginning of round. [DE]
RoundStartTime = tick() -- The round start time is set by the current time. [DE]
end
--[Function that defines beginning of intermission]
local function initialize2()
IntermissionStartTime = tick()
end
--[Functions & Variables for your round]
local function YourFunction() -- This is the name of your function! [CE/CD]
local YourVariable = ("This is a string!") -- This is a variable that holds a string value, but you can change that. [CE/CD]
print (YourVariable) -- This is what your function does. [CE/CD]
end
--[The round in action]
while true do -- "while true do" creates a loop. [DE]
initialize() -- "initialize" function is fired. [DE]
repeat -- Tells to repeat whatever is below until something stops it. [DE]
local currentTime=tick() -- The variable, "currentTime", is created.[DE]
local TimeSinceGameStarted= currentTime - RoundStartTime -- Defines "TimeSinceGameStarted" as the current time subtracted by the time when the round started. [DE]
--[GUI in action]
local countdown = game.StarterGui.Timer.Countdown
countdown.Value.Value = MaxRoundTimeInSeconds
for i=1, MaxRoundTimeInSeconds do
countdown.Value.Value = countdown.Value.Value - 1
countdown.Text = countdown.Value.Value
wait(1)
end
--[Functions fired in round]
YourFunction() -- This fires the function you created. Rename this if you renamed the previous "YourFunction". [CE]
wait(0.25) -- Wait one fourth of a second before repeating again.
until TimeSinceGameStarted > MaxRoundTimeInSeconds -- Repeat until the max round time in seconds is reached...
wait(IntermissionTimeInSeconds) --... Wait the intermission time that was set.
end
(The comments is for people who use it once I'm done making the kit)
The "GUI in action" section is the place where you should focus. I don't get what's wrong with it. When I test the game out, the gui's text says "8" and stays that way, as the value that's inside that gui counts down starting at 0, going into the negatives. Can someone try to figure out what I did wrong? I tried many ways and none of them seems to work!

2 comments
Try checking if the Text is the same as the numberValue then continue counting.
Thank you for making this kit by the way. Not many people go out of the way to help the community like this, and these help people who can't script a lot!