Modding Tiny Strats
Players can write scripts that change gameplay on their private servers: rules, gamemodes, map edits, spawns, chat commands, damage rules and on-screen panels. This is the modder's guide and API reference.
LifecycleStarting, matches, errors, stale handles and what stopping cleans up.
The languageThe Luau subset, standard library, tasks, coroutines and interop.
API referenceSignals, hooks, Game, Teams, Units, Players, Map, Zones, Storage, UI.
Reference listsGame states, GameConfig keys, status effects, tags, attributes, modifiers, zones.
LimitsCPU budgets, rate limits and memory caps that protect the server.
Sharing modsUpload to the Tiny Labs Workshop and run other players' mods.
Example modsComplete mods you can paste into the console and run.
Quickstart
- Join a private server you own, or play in Studio.
- Open Main Menu > Settings > Mods. The console has the editor, your saved mods, the list of running mods and the output log.
- Paste this and press Run:
print("Hello from " .. Mod.Name)
local function setup()
Game.Announce("Modded match! Everyone starts with 500 money.")
for _, team in Teams.GetTeams() do
team.Money = 500
end
end
if Game.IsRunning() then setup() end -- the mod may start mid-match
Game.MatchStarted:Connect(setup)
Players.Chatted:Connect(function(player, message)
if message == "!heal" and player.Team then
for _, unit in player.Team:GetUnits() do
unit.Health = unit.MaxHealth
end
player:Notify("Healed your units")
end
end)
print/warn and errors show up in the output log, tagged with the mod's name.
Example mods: the test suite compiles every one of them, so they stay valid.
| File | What it shows |
|---|---|
arena_builder.luau | Chat commands, Map.AddBlock, a per-player undo stack |
damage_rules.luau | A Damage hook, a task.wait loop, Units.InRadius, Units.Died |
king_of_the_hill.luau | RegisterGamemode, SetAutoEnd(false) + EndMatch, scoring per second |
scoreboard.luau | UI panels, UI.Format, buttons, a text box, vote to end |
spectator_queue.luau | Spectators, Player:SetTeam, Teams.Eliminated, a "Spectators" panel audience |
Who can run mods
- Only in private servers (
PrivateServerOwnerId ~= 0), servers made with Create Server (their host is the owner), and in Studio. In Studio, everyone can run them. - Only players with ServerAdmin rank Owner or higher (the private-server owner, moderators, devs). Server admins that the owner appoints cannot run code.
- Mods keep running when the player who started them leaves (and when nobody who may manage them is left). The mod still belongs to that player: its
Storage, the author of its text andMod.GetOwnerstay theirs. - Once any mod has run, quest progress is frozen for the rest of the server's life, so quests cannot be farmed. Private servers already give no match rewards.