Tiny Strats Modding

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.

Quickstart

  1. Join a private server you own, or play in Studio.
  2. Open Main Menu > Settings > Mods. The console has the editor, your saved mods, the list of running mods and the output log.
  3. 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.

FileWhat it shows
arena_builder.luauChat commands, Map.AddBlock, a per-player undo stack
damage_rules.luauA Damage hook, a task.wait loop, Units.InRadius, Units.Died
king_of_the_hill.luauRegisterGamemode, SetAutoEnd(false) + EndMatch, scoring per second
scoreboard.luauUI panels, UI.Format, buttons, a text box, vote to end
spectator_queue.luauSpectators, Player:SetTeam, Teams.Eliminated, a "Spectators" panel audience

Who can run mods