Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I have a live event for a game. Why won't it start at the given UTC time?

Here's my script for the time of the event.

local EventTime = os.time({year=2020; month=4 ; day=12; hour=18; min=20})-- <-- UTC time.
local MainModule = require(script.Parent.Actions)

while true do
	local SecondsBetween = os.difftime(EventTime,os.time())
	local SecsTill = SecondsBetween%60
	local MinutesTill = math.floor(SecondsBetween%3600/60)
	local HoursTill = math.floor(SecondsBetween%86400/3600)
	local DaysTill = math.floor(SecondsBetween%(86400*30)/86400)
	if SecondsBetween <= 0 and SecondsBetween >= -2 then
		break
		end
	wait()
end

Here's my live event actions ModuleScript

local module = {}

module.Main = function()
	workspace.Sound:Stop()
	local g = Instance.new("Hint",workspace)
			g.Text = "NUCLEAR EXPLOSION IMMINENT! BRACE FOR DESTRUCTION!"
	wait(3)
			g.Text = "The Town of Overboard City will be destroyed in 10 seconds."
	wait(5)
			g.Text = "The Town of Overboard City will be destroyed in 5 seconds."
	wait(1)
			g.Text = "The Town of Overboard City will be destroyed in 4 seconds."
	wait(1)
			g.Text = "The Town of Overboard City will be destroyed in 3 seconds."
	wait(1)
			g.Text = "The Town of Overboard City will be destroyed in 2 seconds."
	wait(1)
			g.Text = "The Town of Overboard City will be destroyed in 1 seconds."
	wait(1)
			g:Destroy()
	
	workspace.Gate.Voice.Disabled = false
	workspace.Orb:Destroy()
	wait(4)
	workspace.Town:Destroy()
	workspace.SurfaceGuiTest:Destroy()
	
	game.Lighting.Ambient = Color3(255, 000, 000)
	game.Lighting.OutdoorAmbient = Color3(255, 000, 000)
end

return module

Can somebody show me what's wrong with these scripts?

1 answer

#Problems You forgot 1 line of code. You didn't Call the Main function when the loop breaks

#Solution

Add

MainModule.Main()

at the end of the script

7 comments

0

Luka, which script do I put "MainModule.Main()" in

0

the first one

0

ok

0

if it worked please accept the answeer

0

It works in studio, but not a real game of it.

0

its probably because hints are deprecated

0

Hints still work in the client

This discussion is preserved as it was. New answers, comments, and votes are closed.