Live event countdown

I want to make a rocket live event (test) and i want to launch the rocket now and is not working for some reason,here’s the script

local launchEvent = workspace.RocketModel.Launch
local EventStart = 1622463000
local EventStop = 1622466600

local EventTime = workspace.EventText.TextPart.SurfaceGui.EventTime

while wait(1) do
	local currentTime = os.time()
	
	if currentTime >= EventStop then
		break
	end
	
	if currentTime >= EventStart then
		launchEvent:Fire()
		EventTime.Text = "Starting live event!"
		break
		
	else
		local secondsleft = EventStart - currentTime
		local days = math.floor(secondsleft % (60*60*24*30) / (60*60*24))
		local hours = math.floor(secondsleft % (60*60*24) / (60*60))
		local minutes = math.floor(secondsleft % (60*60) / 60)
		local seconds = secondsleft % 60
		
		EventTime.Text = "Time till live-event: "..days.." Days "..hours.." Hours "..minutes.." Minutes "..seconds.." seconds!"
		
	end

Here is what is saying:

Picture

1 Like

your math is confusing, here’s the time generator

const time = 10000 - 1
const days = math.floor(time / ((60 * 60) * 24))
-- bla bla bla
1 Like

I find insufficient information about what the issue is. It looks like the launchEvent is fired and that the rocket isn’t exactly launching as intended?

I love that. It’s a simple, straightforward quote. Idk why, but it made me laugh. xD

1 Like

Can’t understand what you said. If I would be making a live event I would just update the text in the gui every second then start the event when gui text is 0.

Did you get this from @Joriangames?? He made a Vid on this, and It looks suspiciously like that lol.

1 Like

What’s not working exactly? Are there any errors in the output?

Full Credits to @Joriangames

local launchEvent = workspace.RocketModel.Launch
local EventStart = -- Start Time Here
local EventStop = -- End Time Here

local EventTime = workspace.EventText.TextPart.SurfaceGui.EventTime

while wait(1) do
local currentTime = os.time()

if currentTime >= EventStop then
	break
end

if currentTime >= EventStart then
	launchEvent:Fire()
	EventTime.Text = "Starting live event!"
	break
	
else
	local secondsleft = EventStart - currentTime
	local days = math.floor(secondsleft % (60*60*24*30) / (60*60*24))
	local hours = math.floor(secondsleft % (60*60*24) / (60*60))
	local minutes = math.floor(secondsleft % (60*60) / 60)
	local seconds = secondsleft % 60
	
	EventTime.Text = "Time till live-event: "..days.." Days "..hours.." Hours "..minutes.." Minutes "..seconds.." seconds!"
	
end
end
1 Like

@Marius198016 You didn’t end the while loop, you only ended the if-statements

1 Like

Thanks soo much!I really appreciate!

1 Like