
πLibraries
Libraries allows you to organize functions that perform similar actions.
What Are Libraries?
Built-In Libraries
Events
local sayHello = Noir.Libraries.Events:Create()
sayHello:Connect(function(name)
print("Hello, "..name)
end)
sayHello:Once(function(name) -- Only ever gets triggered once
print("Hello and bye forever, "..name)
end)
for _ = 1, 5 do
sayHello:Fire("Cuh4")
end
--[[
terminal:
"Hello, Cuh4"
"Hello and bye forever, Cuh4"
"Hello, Cuh4"
"Hello, Cuh4"
"Hello, Cuh4"
"Hello, Cuh4"
]]
-- You can also disconnect a connection (function binded to an event) from an event
local connection = sayHello:Connect(function()
-- Code
end)
connection:Disconnect()
-- Or even manually trigger the connection
connection:Fire()Creating A Library
Retrieving A Library
Adding Credit
Last updated