Skip to content

dig1t/roblox-modules

Repository files navigation

roblox-modules

A comprehensive collection of utility modules and libraries for Roblox game development.

CI

Installation

Using Wally (Recommended)

Available modules:

Animation = "dig1t/[email protected]"
Badge = "dig1t/[email protected]"
Cache = "dig1t/[email protected]"
GamePass = "dig1t/[email protected]"
Maid = "dig1t/[email protected]"
Palette = "dig1t/[email protected]"
ProfileDB = "dig1t/[email protected]"
Promise = "dig1t/[email protected]"
Ragdoll = "dig1t/[email protected]"
ReactUtil = "dig1t/[email protected]"
Replica = "dig1t/[email protected]"
Signal = "dig1t/[email protected]"
State = "dig1t/[email protected]"
Trash = "dig1t/[email protected]"
Util = "dig1t/[email protected]"

Use version ^1.0 on any module to use its latest version.

Core Utilities

Game Systems

UI & Visuals

Usage Examples

Util

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Util = require(ReplicatedStorage.Packages.Util)

-- Player touch detection
local touchPart: BasePart = workspace:WaitForChild("Plate")
local connection = Util.onPlayerTouch(touchPart, function(player: Player)
    print(player.Name .. " touched the part!")

    if connection then
        connection:Disconnect()
    end
end)

Promise

local Promise = require(ReplicatedStorage.Packages.Promise)

-- Create and use a promise
local myPromise: Promise.Promise = Promise.new(function(resolve, reject)
    -- Async operation
    local success = pcall(function()
        -- Simulate some work
        task.wait(2)
        print("Data loaded successfully")
    end)

    if success then
        resolve(data)
    else
        reject(error)
    end
end)

myPromise:andThen(function(result)
    print("Success:", result)
end):catch(function(err)
    warn("Error:", err)
end)

Maid

local Maid = require(ReplicatedStorage.Packages.Maid)

local myMaid = Maid.new()

-- Add tasks to be cleaned up later
myMaid:Add(workspace.ChildAdded:Connect(function() end))
myMaid:Add(function() print("Cleanup!") end)

-- Clean up all tasks
myMaid:Clean()

Palette

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Palette = require(ReplicatedStorage.Packages.Palette)

-- Get a specific color
local blueColor = Palette.get("blue", 500)
print(blueColor) -- Color3 value

Cache

local Cache = require(ReplicatedStorage.Packages.Cache)

local myCache = Cache.new()

-- Store and retrieve data
myCache:Set("playerStats", { coins = 100, level = 5 })
local stats = myCache:Get("playerStats")
print(stats.coins) -- 100

Types Support

All modules include type definitions for Luau's type checking system. You can import types directly:

local Promise = require(ReplicatedStorage.Packages.Promise)

type Promise = Promise.Promise

local myPromise: Promise = Promise.new(function(resolve)
    resolve(true)
end)

About

Modules and Libraries for development in Roblox

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Languages