An open-source utility library for Roblox module loading.
Project details
GMLK, is an open-source Luau framework designed for loading modules in Roblox efficiently. With a range of utilities for numbers, math, tables, and more, GMLK streamlines the integration of client and server modules, ensuring a smooth startup sequence. Perfect for developers looking to enhance their Roblox projects.
GMLK, is an open-source framework designed specifically for loading Roblox modules via Init and Start hooks. This powerful Luau library not only facilitates module loading but also provides a comprehensive set of utilities that include mathematical operations, timestamps, durations, tables, signals, remotes, cleanup methods, state management, pooling, timing functions, attributes, randomness, and tweening capabilities.
Init and Start hooks, allowing multiple client and server modules to coordinate effectively.GMLK is ideal for projects requiring a consistent structure and dependencies between multiple modules. The framework does not replace Roblox's require functionality; instead, it enhances it by managing the loading order and providing additional features.
Define a lifecycle module that encapsulates logic in the order of operations, with example code demonstrating GMLK's utilization:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local GMLK = require(ReplicatedStorage.Modules.Library.GMLK)
local Coins = { Priority = 10 }
function Coins:Init()
self.Amount = 0
self.Changed = GMLK.Signal.New()
end
function Coins:Start()
self.Amount += 1000
self.Changed:Fire(self.Amount)
print(GMLK.Number.Abbreviate(self.Amount))
end
return Coins
GMLK also includes a RateLimiter module, which can bind to various remote events, providing independent access control for players. This feature is particularly useful in scenarios requiring moderation of request rates, enhancing the overall user experience by preventing abuse.
Example of rate limiting usage:
local PurchaseLimit = GMLK.RateLimiter.New(5, 10)
local PurchaseBinding = PurchaseLimit:BindEvent(Remotes:WaitForChild("Purchase"), function(Player, ItemId)
print(Player.Name, ItemId)
end)
GMLK organizes modules within specific locations in Roblox, ensuring clarity and ease of access. The recommended layout includes:
ReplicatedStorage.Modules.Library.GMLK: Root ModuleScript and its utilities.ReplicatedStorage.Modules.Client: For client modules.ServerStorage.Modules.Client: For server modules.GMLK welcomes contributions from developers looking to enhance the framework's capabilities. A detailed contribution guide provides guidelines for joining the community.
Comments
0Start the conversation
Share the first comment.