Hello there. I made a quick community resource for my project within the timespan of ~5-10 minutes. It’s super self explanatory code but also helps keep your functions, modular code, and client code organized.
Here is a code showing how Ux works (Very simple)
local Replicated = game:GetService("ReplicatedStorage")
local Ux = require(Replicated:WaitForChild("Ux"))
--// Function Categories
local Functions = {
Printing = {};
Loops = {};
Task = {};
};
--// Interior Functions
function Functions.Printing.Print(String: string)
print(String)
end
function Functions.Printing.Warn(String: string)
warn(String)
end
function Functions.Printing.Err(String: string)
local success, response = pcall(function()
error(String)
end)
end
function Functions.Loops.StartMainLoop(Threshold: number)
task.spawn(function()
while task.wait(Threshold) do
Functions.Printing.Print(`This loop prints every {Threshold} seconds!`)
end
end)
end
function Functions.Task.Sleep(Duration: number)
task.wait(Duration)
end
--// Function Registery
Ux.Gateways.New("Printing", Functions.Printing)
Ux.Gateways.New("Loops", Functions.Loops)
Ux.Gateways.New("Task", Functions.Task)
--// Function Calling
Ux.Gateways.Get("Printing").Print("A loop will begin shortly.")
Ux.Gateways.Get("Task").Sleep(2);
Ux.Gateways.Get("Loops").StartMainLoop(2)
--[[
. Register functions
. Output "A loop will begin shortly."
. Wait two seconds
. Trigger "StartMainLoop" function with threshold of two
. Output "This loop prints every {Threshold} seconds"
]]
All you have to do is put Ux in ReplicatedStorage and boom. You have Ux installed.
Install Ux here