Skip to main content

roblox-modules

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

CI

Installation

Available modules:

Animation = "dig1t/animation@1.0.8"
Badge = "dig1t/badge@1.0.5"
Cache = "dig1t/cache@1.0.10"
GamePass = "dig1t/gamepass@1.0.9"
Maid = "dig1t/maid@1.1.0"
Palette = "dig1t/palette@1.0.1"
ProfileDB = "dig1t/profiledb@1.0.5"
Promise = "dig1t/promise@1.1.3"
Ragdoll = "dig1t/ragdoll@1.0.4"
ReactUtil = "dig1t/react-util@1.0.6"
Replica = "dig1t/replica@1.0.4"
Signal = "dig1t/signal@1.0.1"
State = "dig1t/state@1.2.1"
Trash = "dig1t/trash@1.0.4"
Util = "dig1t/util@1.0.19"

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)