You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
694 B
26 lines
694 B
Events = {} |
|
|
|
function Events:RegisterEvent(eventName) |
|
self[eventName] = { |
|
Functions = {}, |
|
Add = function(func) |
|
table.insert(self[eventName].Functions, func) |
|
end, |
|
Remove = function(func) |
|
for i, f in ipairs(self[eventName].Functions) do |
|
if f == func then |
|
table.remove(self[eventName].Functions, i) |
|
break |
|
end |
|
end |
|
end, |
|
Trigger = function() |
|
for _, func in ipairs(self[eventName].Functions) do |
|
func() |
|
end |
|
end, |
|
} |
|
end |
|
|
|
Events:RegisterEvent("OnGameBoot") |
|
Events:RegisterEvent("OnGameStart")
|
|
|