Reference

Scripting API

Every class, property, callback, and command — fully documented.

v1.0Exported: 2026-05-26 01:01
Block
▼
Base class for all placeable blocks in the world. Handles health tracking

Properties

NameTypeDefaultDescription
maxHealthnumber50Maximum health this block starts with. Set on subclasses.
blastResistancenumber50Blast resistance — energy drained from an explosion per block.
maxStressnumber50Maximum structural stress this block can bear before collapsing.
healthanyself.maxHealth or 50
healthany(self.health or 0) - amount

Methods & Callbacks

onCreate()
Called server-side when this block is placed in the world.
onDamage(amount, source)
Called server-side when this block receives damage.
  • amount number — Damage amount to apply.
  • source any — The entity or tool that caused the damage.
onDestroy(source)
Called server-side when this block's health reaches zero.
  • source any — The entity or tool that delivered the killing blow.
Effect
▼
Base class for all status effects (burning, bleeding, poisoned, etc.).

Properties

NameTypeDefaultDescription
tickIntervalnumbernilHow often (in seconds) onTick fires. Leave nil to disable tick timers.
durationnumber5Duration of this effect in seconds. Used by the effect manager to schedule expiration.

Methods & Callbacks

onApply(target)
Called server-side when this effect is applied to an entity.
  • target PlayerState — The player or entity the effect is applied to.
onTick(target)
Called server-side on each tick interval while the effect is active.
  • target PlayerState — The player or entity currently affected.
onExpire(target)
Called server-side when this effect expires or is removed.
  • target PlayerState — The player or entity the effect is expiring on.
Item
▼
Base class for all items in the game. Every weapon, tool, consumable,

Methods & Callbacks

onCreate()
Called server-side when this item instance is first created.
onDestroy()
Called server-side when this item instance is destroyed or removed from the world.
onUse(player)
Called server-side when a player uses this item from their inventory.
  • player PlayerState — The player who used the item.
onPlayerHit(attacker, target)
Called server-side when this item is used to hit another player.
  • attacker PlayerState — The player performing the hit.
  • target PlayerState — The player or entity being hit.
Tool extends Item
▼
Base class for all tools. Extends Item with durability tracking and

Properties

NameTypeDefaultDescription
maxDurabilitynumber100Maximum durability this tool starts with. Set on subclasses.
durabilityanyself.maxDurability or 100
durabilityany(self.durability or 0) - amount

Methods & Callbacks

onCreate()
Called server-side when this tool is first created.
onPlayerHit(attacker, target)
Called server-side when this tool is used to hit another player.
  • attacker PlayerState — The player performing the hit.
  • target PlayerState — The player or entity being hit.
wearDown(amount)
Reduces durability by the given amount.
  • amount number — Amount to subtract from current durability.
onBreak()
Called server-side when the tool's durability reaches zero.
Weapon extends Item
▼
Base class for all weapons. Extends Item with damage application on hit.

Properties

NameTypeDefaultDescription
baseDamagenumber10Base damage dealt per hit. Overridden by each weapon definition.
damageanyself.baseDamage or 10

Methods & Callbacks

onCreate()
Called server-side when this weapon is first created.
onPlayerHit(attacker, target)
Called server-side when this weapon connects with another player or entity.
  • attacker PlayerState — The player swinging or firing the weapon.
  • target PlayerState — The player or entity being hit.
Zombie
▼
Base class for all zombie types. Handles health, spawning, death, and

Properties

NameTypeDefaultDescription
maxHealthnumber100Maximum health this zombie spawns with. Set on subclasses.
speednumber3Walk speed in metres per second.
attackDamagenumber5Damage dealt per attack.
attackRangenumber1.5Melee attack range in metres.
animControllerstring""Reference to the RuntimeAnimatorController asset path.
lootTablestring"zombie_loot_basic"Loot table id used when this zombie dies.
CanSmashbooleanfalseWhether this zombie can smash through structural blocks.
CanCrawlbooleanfalseWhether this zombie can crawl under low obstacles.
IrradiatedbooleanfalseWhether this zombie is irradiated (applies radiation damage on hit).
unlockThresholdnumber0Minimum BossesKilled count required to unlock this zombie type.
healthanyself.maxHealth or 100

Methods & Callbacks

onCreate()
Called server-side when this zombie is spawned into the world.
onDeath()
Called server-side when this zombie's health reaches zero.
onAttack(target)
Called server-side when this zombie performs an attack.
  • target PlayerState — The player or entity being attacked.
Chat Commands▼
Permission levelsA numeric value from 0 (any player) to 1000 (super admin). Commands are only available to players whose permission level meets or exceeds the required value. The values shown in the table are examples only — no fixed role names are defined.
CommandSyntaxPermissionDescription
damagezombie[entityId] [amount]AdminDamages a zombie.
destroyblock[x] [y] [z]AdminDestroys a block.
flyAdminToggles flight mode.
getpermission[playerId]AdminReturns a player's current permission level.
giveitem[playerName] [itemId] [qty]AdminGives items to a player.
helpPlayerLists all available console commands.
help[command]PlayerLists all commands available to you, or details for a specific command.
killplayer[playerName]AdminKills a player.
killzombie[entityId]AdminKills a zombie.
lua.callPlayerCalls a global Lua function by name. Usage: /lua.call <functionName>
lua.filesPlayerLists all loaded Lua script files from StreamingAssets/Scripts.
quitPlayerQuits the application.
runPlayerRuns a game command through CommandRegistry with full authority. Usage: /run <command> [args...]
setblock[x] [y] [z] [typeId]AdminSets a block at a grid position.
sethealth[playerName] [amount]AdminSets a player's health.
setpermission[playerId] [level]MaxLevelSets a player's permission level (persisted to permissions.txt).
settime[0.0-1.0]AdminSets the normalized in-game time.
setweather[weatherId]AdminSets the current weather.
spawnblock[blockId]ModeratorSpawns a registered block entity at your position.
spawnzombies[type=zombie_basic] [count=6] [radius=8]AdminSpawns a group of zombies at your position.
speed[value]AdminGets or sets walk speed.
sprintspeed[value]AdminGets or sets sprint speed.
summon[zombieType]AdminSpawns a zombie at your position.
takedamage[playerName] [amount]AdminDeals damage to a player.
teleport[playerName] [x] [y] [z]ModeratorTeleports a player to world coordinates.
tp[playerName] [x] [y] [z]ModeratorAlias for /teleport.
triggerhorde[waveId]AdminTriggers a horde wave at the calling player's position.