Hello! I came to the forums for a scripting question on how I would make a timer.
A custom countdown clock The reason I want a custom countdown clock is for such reasons as, a community event, group event, giveaway, etc.
What should I do? I’m new to scripting, so if somebody could help me create a script or find one that works well, that would be awesome.
What solutions have you tried so far? I tried finding some countdown scripts and changing them, but the way they are scripted is very confusing considering if you want multiple days and or hours.
local time = 60
while wait(1) do
if time == 0 then
gui.TextLabel.Text = "Times up!"
break
else
gui.TextLabel.Text = tostring(time) --sets onscreen gui timer
time = time - 1
end
end
just make a function called liveEvent() and put whatever code you want to run when the live event starts (for example lava rising)
then make a variable timeToStart and make it’s value the time you want it to start in epoch time, so use an epoch converter for that
then make a variable timeToStop so when a new server starts up after this time it will not run but if it has not hit this time it will still run
then make a while wait(1) do
then make a variable local time = os.time()
then do if time >= timeToStop then the epoch time has exceeded the timeToStop so then you just write break inside
then do a if time >= timeToStart then
run the function liveEvent()
then write break
end
end
How I learned to script was to watch other people’s videos on them making games and I just followed along and after doing lots of them I just learned how to do it myself
It is not a BindableFunction or a RemoteFunction, it is just a function in a script
To create one do this
function liveEvent()
the code when the live event starts (look at other posts to learn how to make something like lava rising or rockets firing or fireworks)
end