Live Event Module

this class uses os.date to loop through dates, this helps you create live events

LiveEvent.rbxm (103.1 KB)

live.remove(name : string, DoDebug):

script source:

local liveEvent = require(script.LiveEvent)
liveEvent.remove(“Bomb”, true)

live.new(timeOfEvent : string, name : string , DoDebug ,liveFunction : function):

script source:

local liveEvent = require(script.LiveEvent)
liveEvent.new(“Wed Jul 28 14:02:22 2021”,“Bomb”,true,function()
for i = 1, 20 do
local secret = game:GetService(“InsertService”):LoadAsset(187789986)
secret.Parent = workspace
secret:MoveTo(Vector3.new(0, 8, 0))
end
end)

Any questions

6 Likes

This is actually amazing! Great work. :+1:

I’m a little confused on the implementation method. First, this would seemingly yield the thread and make it impossible to run 2 events simultaneously without doing something like this:

coroutine.wrap(function()
	liveEvent.new("Wed Jul 28 14:02:22 2021","Test",true,function()
		print("Go")
	end)
end)()

You should probably wrap it in a coroutine inside of new yourself to handle this.

Secondly, there’s no way to free the event from memory because the module doesn’t do that as using LiveEvent.remove just disables the loop but doesnt remove it from memory.

Thirdly, a better method than while wait(1) do would be to calculate the time until the event and wait once. This is less intensive on memory and includes no looping, though you’d have to check if it was disabled after the entire time which may not be what you’re going for.

Good idea, but it can be done in a better way that uses less memory and no looping.

1 Like

Thank you for your feedback i’m just a starter learning new APIS i will continue learning about coroutine APIS