Core

Description

This category describes methods and properties that are built into ScriptTiles.

Methods

PrintPrints text in the Scripts Console
GetCurrentTileRetrieves the Tile object for the current ScriptTile
EnumToNumberCasts the provided enum to a number and returns it

Properties

number deltaTimeTime elapsed between the current and the previous frame
number fixedDeltaTimeThe interval at which physics updates are performed

Print

Declaration

Print(string Text)

Description

Outputs the provided Text in the Scripts Console.

--Prints "Hello World" in the Scripts Console
Print("Hello World!");

GetCurrentTile

Declaration

GetCurrentTile()

Description

Returns the Tile object for the ScriptTile that is running the current script.

--Prints the position of the ScriptTile this script is running on
local currentTile = GetCurrentTile();

Print("X: " .. currentTile.Position.x .. " Y: " .. currentTile.Position.y);

EnumToNumber

Declaration

EnumToNumber(enum Enum)

Description

Casts the provided Enum to a number and returns it.

--Casts the Team.Red value to a number, which equals 1, then prints it
local team = EnumToNumber(Team.Red);

Print(EnumToNumber(team));

Game

Description

Provides methods to interface with the game world itself. Not to be confused with the World.

Methods

SpawnBombSpawns a bomb
SpawnExplosionSpawns an explosion
GetGameSchemeReturns match settings
GetSDTimeReturns how many seconds until Sudden Death starts
SetSDTimeSets how many seconds until Sudden Death starts, but only if the timer hasn't stopped already
EndRoundEnds the currently on-going round
AwardWinAwards wins to players

Game.SpawnBomb

Declaration

Game.SpawnBomb(Vector3 Position, number Power, bool PlaySound)

Description

Spawns a Bomb at a given Position with provided Power. PlaySound decides if the ticking sound effect should be played.

local SpawnPos = V3(5, 2, 3);
local BlastRadius = 5;

Game.SpawnBomb(SpawnPos, BlastRadius);

Declaration

Game.SpawnBomb(Vector3 Position, number Power, bool PlaySound, Direction PushDirection)

Description

Spawns a Bomb at a given Position with provided Power, and then pushes it in the PushDirection direction. PlaySound decides if the ticking sound effect should be played.

local Push = Direction.Right;

Game.SpawnBomb(V3(2, 1, 2), 3, Push);

Declaration

Game.SpawnBomb(Vector3 Position, number Power, bool PlaySound, Vector3 LaunchTarget, number Speed)

Description

Spawns a Bomb at a given Position with provided Power, and then launches it towards LaunchTarget position with Speed. Launching works similar to the Launcher tile. PlaySound decides if the ticking sound effect should be played.

local Position = V3(1, 0, 5);
local Power = 2;
local LaunchTarget = V3(10, 1, 10);
local Speed = 1;
Game.SpawnBomb(Position, Power, LaunchTarget, Speed);

Declaration

Game.SpawnBomb(Vector2 Position, number Layer, number Power, bool PlaySound)

Description

Spawns a Bomb at a given Tile located at Position on Layer with provided Power. PlaySound decides if the ticking sound effect should be played.

Bomb placement is more accurate when using this method on Slopes.

Works similar to the Spawn Bomb trigger action.

local SpawnPos = V2(2, 1);
local Layer = 0;
local BlastRadius = 2;

Game.SpawnBomb(SpawnPos, Layer, BlastRadius);

Declaration

Game.SpawnBomb(Vector2 Position, number Layer, number Power, bool PlaySound, Direction PushDirection)

Description

Spawns a Bomb at a given Tile located at Position on Layer with provided Power, and then pushes it in the PushDirection direction. PlaySound decides if the ticking sound effect should be played.

Bomb placement is more accurate when using this method on Slopes.

Works similar to the Spawn Bomb trigger action.

local PushDir = Direction.Up;

Game.SpawnBomb(V2(3, 5), 0, 2, PushDir);

Declaration

Game.SpawnBomb(Vector2 Position, number Layer, number Power, bool PlaySound, Vector3 LaunchTarget, number Speed)

Description

Spawns a Bomb at a given Tile located at Position on Layer with provided Power, and then launches it towards LaunchTarget position with Speed. Launching works similar to the Launcher tile. PlaySound decides if the ticking sound effect should be played.

Bomb placement is more accurate when using this method on Slopes.

Works similar to the Spawn Bomb trigger action.

local Position = V2(1, 5);
local Layer = 0;
local Power = 2;
local LaunchTarget = V3(10, 1, 10);
local Speed = 1;
Game.SpawnBomb(Position, Layer, Power, LaunchTarget, Speed);

Game.SpawnExplosion

Declaration

Game.SpawnExplosion(Vector3 Position, number Power)

Description

Spawns an Explosion at a given Position with provided Power.

local SpawnPos = V3(5, 0.5, 3);
local BlastRadius = 5;

Game.SpawnExplosion(SpawnPos, BlastRadius);

Declaration

Game.SpawnExplosion(Vector3 Position, number Power, bool DontOptimize, bool DontOptimizeTrigger, bool PreventNormalExplosionOptimization)

Description

Spawns an Explosion at a given Position with provided Power.

DontOptimize if set to true will cause this explosion to overlap other normal explosions.

DontOptimizeTrigger if set to true will cause this explosion to overlap other trigger or script spawned explosions.

PreventNormalExplosionOptimization if set to true will cause other explosions to overlap this one.

All of these options should be used sparingly. When an explosion is about to spawn at a position, the game looks for an existing one there, and if it finds one, it resets the timer on that explosion instead of spawning another one, for performance reasons. These options effectively prevent that from happening, and if used frequently could lead to worse performance.

local SpawnPos = V3(5, 0.5, 3);
local BlastRadius = 5;

Game.SpawnExplosion(SpawnPos, BlastRadius, true, true, true);

Game.GetGameScheme

Declaration

Game.GetGameScheme()

Description

Returns the GameScheme object with the match settings.

--Gets the game scheme and prints some of its settings in the Scripts Console
local scheme = Game.GetGameScheme();

Print("Starting Bombs: " .. scheme.StartingBombs);
Print("Starting Blast Radius: " .. scheme.StartingPower);
Print("Preserve Shield: " .. tostring(scheme.PreserveShield));
Print("Drop Chance: " .. scheme.DropChance);
Print("Impact Bombs: " .. tostring(scheme.ImpactBombs));
Print("Game mode: " .. tostring(scheme.GameMode));

Game.GetSDTime

Declaration

Game.GetSDTime()

Description

Returns how many seconds until Sudden Death starts.

--Gets the remaining sudden death time in seconds and prints it in the Scripts Console
local SDTime = Game.GetSDTime();

Print(SDTime);

Game.SetSDTime

Declaration

Game.SetSDTime(number Time)

Description

Sets how many Time seconds until Sudden Death starts, but only if the timer hasn't stopped already.

--Gets the current Sudden Death time in seconds, adds 10 seconds to it,
--then sets the new time
local SDTime = Game.GetSDTime();
SDTime = SDTime + 10;

Game.SetSDTime(SDTime);

Game.EndRound

Declaration

Game.EndRound()

Description

Ends the currently on-going round, and awards wins to players.

Game.EndRound();

Game.AwardWin

Declaration

Game.AwardWin(number PlayerID, number Wins, bool LockWin)

Description

Awards Wins amount of wins to the player with the specified PlayerID. LockWin decides if the Wins can be lost by dying in the standard gamemode.

Wins are only distributed once round ends, not instantly.

--Awards the first player with a win
local allPlayers = Players.GetAll();
Game.AwardWin(allPlayers[1], 1, false);

Declaration

Game.AwardWin(number PlayerID, TargetPlayer Mode, Vector3 Origin, number Wins, bool LockWin)

Description

Awards Wins amount of wins to the specified player(s), depending on the Mode. If using Mode set to Closest or Furthest, the Origin parameter will be used as the point of reference, otherwise Vector3.zero can be passed. LockWin decides if the Wins can be lost by dying in the standard gamemode. Wins are only distributed once round ends, not instantly.

Check TargetPlayer for all possible Mode values.

--Awards everyone but the player with ID 2 with a win
local DontAward = 2;
local Mode = TargetPlayer.Others;
Game.AwardWin(DontAward, Mode, Vector3.zero, 1, false);

--Awards the third player with a win
local allPlayers = Players.GetAll();
Game.AwardWin(allPlayers[3], 1, false);

--Awards everyone on the same team as the passed player with a win
Game.AwardWin(1, TargetPlayer.AllTeamMembers, Vector3.zero, 1, false);

--Awards a random player with a win, the PlayerID parameter is not used
Game.AwardWin(0, TargetPlayer.Random, Vector3.zero, 1, false);

--Awards the closest player to the middle of the map with a win, PlayerID is once more not used
local world = World.GetSettings();
Game.AwardWin(0, TargetPlayer.Closest, V3(world.Width / 2, 1, world.Height / 2), 1, false);

Declaration

Game.AwardWin(Dictionary<number> PlayerIDs, number Wins, bool LockWin)

Description

Awards Wins amount of wins to the specified players. LockWin decides if the Wins can be lost by dying in the standard gamemode.

Wins are only distributed once round ends, not instantly.

--Retrieves every single player and awards them wins
local allPlayers = Players.GetAll();
Game.AwardWin(allPlayers, 1, false);

--Awards the second and fourth players with two wins and locks them
Game.AwardWin({allPlayers[2], allPlayers[4]}, 2, true);

Note

Player IDs must be whole numbers.

Keep in mind the Player IDs aren't necessarily ordered. Players can join and leave in the lobby, potentially several times, increasing their ID, which is why using Players.GetAll is advised if you want to target a player at a specific slot.

You can also pass Player objects instead of numbers as IDs.

World

Description

Provides methods to read and modify World data.

Methods

SetTileHeightSets tile height
ModTileModifies properties on a tile at a given position
SetTileSets a tile, replacing the existing one at a given position
GetTileReturns a tile at a given position
GetSettingsReturns world settings in the form of a WorldProxy object

World.SetTileHeight

Declaration

World.SetTileHeight(Vector2 Position, number Layer, number Height, number ExtendCount)

Description

Sets the desired Height and ExtendCount on a specific tile at Position on Layer.

--Sets the tile height at position "target" and "layer" 0 to 3 and extend count to 1
local target = V2(1, 2);
local layer = 0;
local height = 3;
local extendCount = 1;

World.SetTileHeight(target, layer, height, extendCount);

Declaration

World.SetTileHeight(Dictionary<Vector2> Positions, number Layer, number Height, number ExtendCount)

Description

Sets the desired Height and ExtendCount on specific tiles at Positions on Layer.

--Sets the tile height at provided positions to 3 and extend count to 1
local targets = {V2(1, 2), V2(1, 3), V2(1, 4), V2(1, 5), V2(2,2), V2(2,3), V2(2,4), V2(2,5)};
local layer = 0;
local height = 3;
local extendCount = 1;

World.SetTileHeight(targets, layer, height, extendCount);

Declaration

World.SetTileHeight(Vector2 Position, number Layer, number Height, number ExtendCount, bool Relative, Vector2 Origin)

Description

Sets the desired Height and ExtendCount on a specific tile at Position on Layer. Position can be relative to Origin if Relative parameter is true.

--Sets the tile height on the tile above the ScriptTile to 3 and extend count to 1
local currentScriptTile = GetCurrentTile();
local layer = 0;
local height = 3;
local extendCount = 1;

World.SetTileHeight(V2(0, 1), layer, height, extendCount, true, currentScriptTile.Position);

Declaration

World.SetTileHeight(Dictionary<Vector2> Positions, number Layer, number Height, number ExtendCount, bool Relative, Vector2 Origin)

Description

Sets the desired Height and ExtendCount on specific tiles at Positions on Layer. Positions can be relative to Origin if Relative parameter is true.

--Sets the tile height on all the tiles around the ScriptTile to 3 and extend count to 1
local currentScriptTile = GetCurrentTile();
local targets = {V2(0, 1), V2(1, 1), V2(1, 0), V2(-1, 0), V2(-1, -1), V2(0, -1), V2(1, -1), V2(-1, 1)}
local layer = 0;
local height = 3;
local extendCount = 1;

World.SetTileHeight(targets, layer, height, extendCount, true, currentScriptTile.Position);

World.ModTile

Declaration

World.ModTile(Vector2 Position, number Layer, Dictionary Properties)

Description

Modifies the provided Properties for a tile at Position on Layer.

local layer = 0;

--Rotates the stairs to face the right direction
local stairs = V2(3, 5);
local stairProperties = {Direction = Direction.Right};
World.ModTile(stairs, layer, stairProperties);

--Changes the color of a Launcher tile (spring) to cyan
local launcher = V2(5, 5);
local launcherProperties = {Color = Color(0, 255, 255, 255)};
World.ModTile(launcher, layer, launcherProperties);

--Changes the color of a Pusher tile to red, makes it reignite bombs and invert bomb movement on contact
local pusher = V2(5, 3);
local pusherProperties = {ReignitesBomb = true, InvertsBombMovement = true, Color = Color(255, 0, 0, 255)};
World.ModTile(pusher, layer, pusherProperties);

--Changes the color of a Pusher tile to red, makes it reignite bombs and invert bomb movement on contact
local powerup = V2(7, 3);
local powerupProperties = {BlastRadius = 2, GrantsShield = true, GrantsJumping = false};
World.ModTile(powerup, layer, powerupProperties);

Declaration

World.ModTile(Vector2 Position, number Layer, Dictionary Properties, bool Relative, Vector2 Origin)

Description

Modifies the provided Properties for a tile at Position on Layer. Position can be relative to Origin if Relative parameter is true.

local layer = 0;
local currentTile = GetCurrentTile();

--Disables the spikes above the ScriptTile
local relativePos = V2(0, 1);
local spikeProps = {ONDuration = -1, OFFDuration = -1};
World.ModTile(relativePos, layer, spikeProps, true, currentTile.Position);

Declaration

World.ModTile(Dictionary<Vector2> Positions, number Layer, Dictionary Properties)

Description

Modifies the provided Properties for tiles at Positions on Layer.

local layer = 1;

--Detonates several CrateBombs
local positions = {V2(7, 5), V2(4, 3)};
local props = {Detonate = true};

World.ModTile(positions, layer, props);

Declaration

World.ModTile(Dictionary<Vector2> Positions, number Layer, Dictionary Properties, bool Relative, Vector2 Origin)

Description

Modifies the provided Properties for tiles at Positions on Layer. Positions can be relative to Origin if Relative parameter is true.

local layer = 1;
local currentTile = GetCurrentTile();

--Makes the three lasers near the ScriptTile spin, and changes their color
local relativePositions = {V2(0, 1), V2(1, 1), V2(2, 1)};

--Define the color gradient for the laser
local colorGradient = ColorGradient();
colorGradient.AddColor(Color(252, 186, 3, 255), 0);
colorGradient.AddColor(Color(45, 252, 3, 255), 0.5);
colorGradient.AddColor(Color(98, 3, 252, 255), 1);
colorGradient.AddAlpha(255, 0);
colorGradient.AddAlpha(255, 1);

local laserProps = {LaserGradient = colorGradient, ConstantRotation = V3(0, 2, 0)};
World.ModTile(relativePositions, layer, laserProps, true, currentTile.Position);

Note

Not all properties of a particular tile have to be passed into this method, only the ones you want to set.

To see which properties can be modified, check out the Tiles category, or alternatively, use the Edit mode in the Level Editor to see what properties specific tiles have in the Tile Settings panel.

World.SetTile

Declaration

World.SetTile(Vector2 Position, number Layer, TileType Type, Dictionary Properties)

Description

Sets the tile at Position on Layer to Type and then modifies the provided Properties.

local layer = 0;

--Sets a specific tile to Wall
local wallPos = V2(7, 3);
World.SetTile(wallPos, layer, TileType.Wall, {});

--Sets a specific tile to PowerupTile, with changed properties
local powerupPos = V2(8, 3);
World.SetTile(powerupPos, layer, TileType.PowerupTile, {Bombs = 1, BlastRadius = 5});

--Sets a specific tile to Laser, with changed properties

--Define the color gradient for the laser
local colorGradient = ColorGradient();
colorGradient.AddColor(Color(252, 186, 3, 255), 0);
colorGradient.AddColor(Color(45, 252, 3, 255), 0.5);
colorGradient.AddColor(Color(98, 3, 252, 255), 1);
colorGradient.AddAlpha(255, 0);
colorGradient.AddAlpha(255, 1);

local laserPos = V2(9, 3);
World.SetTile(laserPos, layer, TileType.Laser, {LaserGradient = colorGradient, Range = 3, Enabled = false});

Declaration

World.SetTile(Vector2 Position, number Layer, TileType Type, Dictionary Properties, bool Relative, Vector2 Origin)

Description

Sets the tile at Position on Layer to Type and then modifies the provided Properties. Position can be relative to Origin if Relative parameter is true.

local layer = 0;
local currentTile = GetCurrentTile();

--Sets the tile under the ScriptTile to a LandMine
local relativePos = V2(0, -1);
World.SetTile(relativePos, layer, TileType.LandMine, {Delay = 5}, true, currentTile.Position);

Declaration

World.SetTile(Dictionary<Vector2> Positions, number Layer, TileType Type, Dictionary Properties)

Description

Sets the tiles at Positions on Layer to Type and then modifies the provided Properties.

local layer = 0;

--Sets several tiles to MetalCrate
local positions = {V2(4, 4), V2(5, 4), V2(6, 4)};
World.SetTile(positions, layer, TileType.MetalCrate, {});

Declaration

World.SetTile(Dictionary<Vector2> Positions, number Layer, TileType Type, Dictionary Properties, bool Relative, Vector2 Origin)

Description

Sets the tiles at Positions on Layer to Type and then modifies the provided Properties. Positions can be relative to Origin if Relative parameter is true.

local layer = 0;
local currentTile = GetCurrentTile();

--Sets several tiles diagonally relative to the ScriptTile
local relativePositions = {V2(2, 2), V2(2, -2), V2(-2, -2), V2(-2, 2)};
World.SetTile(relativePositions, layer, TileType.CountBomb, {BlastRadius = 10}, true, currentTile.Position);

Note

Not all properties of a particular tile have to be passed into this method, only the ones you want to set.

To see which properties can be modified, check out the Tiles category, or alternatively, use the Edit mode in the Level Editor to see what properties specific tiles have in the Tile Settings panel.

World.GetTile

Declaration

World.GetTile(Vector2 Position, number Layer)

Description

Returns the Tile object for a tile at Position.

--Gets the tile and prints its TileType and position to the Scripts Console
local position = V2(1, 1);
local layer = 0;
local tile = World.GetTile(position, layer);
Print(tile.Type);
Print("X: " .. tile.Position.x .. " Y: " .. tile.Position.y);

Declaration

World.GetTile(Dictionary<Vector2> Positions, number Layer)

Description

Returns the Tile objects for tiles at Positions.

--Gets the tiles and prints their TileTypes and positions to the Scripts Console
local positions = {V2(1, 1), V2(1, 2), V2(2, 1), V2(2, 2)};
local layer = 0;
local tiles = World.GetTile(positions, layer);

for i, tile in ipairs(tiles) do 
    Print(tile.Type);
    Print("X: " .. tile.Position.x .. " Y: " .. tile.Position.y);
end

Declaration

World.GetTile(Vector2 Position, number Layer, bool Relative, Vector2 Origin)

Description

Returns the Tile object for a tile at Position. Position can be relative to Origin if Relative parameter is true.

--Gets the tile to the right of the ScriptTile then prints its TileType and position to the Scripts Console
local currentTile = GetCurrentTile();
local relativePosition = V2(1, 0);
local layer = 0;
local relative = true;
local tile = World.GetTile(relativePosition, layer, relative, currentTile.Position);
Print(tile.Type);
Print("X: " .. tile.Position.x .. " Y: " .. tile.Position.y);

Declaration

World.GetTile(Dictionary<Vector2> Positions, number Layer, bool Relative, Vector2 Origin)

Description

Returns the Tile objects for tiles at Positions. Positions can be relative to Origin if Relative parameter is true.

--Gets the tiles around the ScriptTile and prints their TileTypes and positions to the Scripts Console
local currentScriptTile = GetCurrentTile();
local positions = {V2(0, 1), V2(1, 1), V2(1, 0), V2(-1, 0), V2(-1, -1), V2(0, -1), V2(1, -1), V2(-1, 1)}
local layer = 0;
local tiles = World.GetTile(positions, layer, true, currentScriptTile.Position);

for i, tile in ipairs(tiles) do 
    Print(tile.Type);
    Print("X: " .. tile.Position.x .. " Y: " .. tile.Position.y);
end

World.GetSettings

Declaration

World.GetSettings()

Description

Returns the world settings in the form of a World object.

--Gets the World object and prints its properties to the Scripts Console
local world = World.GetSettings();
Print("World Name: " .. world.Name);
Print("Author: " .. world.Author);
Print("Width: " .. world.Width);
Print("Height: " .. world.Height);

Scripts

Description

This category describes methods used to interface with ScriptTiles.

Methods

SetVarSets editor-exposed variables on ScriptTiles
GetVarGets editor-exposed variables on ScriptTiles
CallFuncCalls a function on ScriptTiles

Scripts.SetVar

Declaration

Scripts.SetVar(Tile ScriptTile, string Name, object Value)

Description

Sets the Name variable value to Value for a ScriptTile.

--Gets the Tile object of the other ScriptTile, 
--and sets the value of the editor-exposed "BlastForce" variable to 5
local otherScriptTile = World.GetTile(V2(4, 5), 0);
Scripts.SetVar(otherScriptTile, "BlastForce", 5);

Declaration

Scripts.SetVar(Tile ScriptTile, Dictionary Variables)

Description

Sets the Variables for a ScriptTile.

--Gets the Tile object of the other ScriptTile, 
--and sets the value of the editor-exposed "BlastForce" and "BlastPosition" variables
local otherScriptTile = World.GetTile(V2(4, 5), 0);
Scripts.SetVar(otherScriptTile, {BlastForce = 5, BlastPosition = V3(5, 1, 4)});

Declaration

Scripts.SetVar(Dictionary<Tile> ScriptTiles, string Name, object Value)

Description

Sets the Name variable value to Value for ScriptTiles.

--Gets the Tile objects of the other ScriptTiles,
--and sets the value of the editor-exposed "BlastForce" variables to 5
local otherScriptTiles = {World.GetTile(V2(4, 5), 0), World.GetTile(V2(2, 5), 0), World.GetTile(V2(0, 5), 0)};
Scripts.SetVar(otherScriptTiles, "BlastForce", 5);

Declaration

Scripts.SetVar(Dictionary<Tile> ScriptTiles, Dictionary Variables)

Description

Sets the Variables for ScriptTiles.

--Gets the Tile objects of the other ScriptTiles, 
--and sets the value of the editor-exposed "BlastForce" and "BlastPosition" variables
local otherScriptTiles = {World.GetTile(V2(4, 5), 0), World.GetTile(V2(2, 5), 0), World.GetTile(V2(0, 5), 0)};
Scripts.SetVar(otherScriptTiles, {BlastForce = 5, BlastPosition = V3(5, 1, 4)});

Scripts.GetVar

Declaration

Scripts.GetVar(Tile ScriptTile)

Description

Returns all the variables from a ScriptTile in the form of a Dictionary.

--Gets the Tile object of the other ScriptTile, 
--and gets all the editor-exposed variables from it,
--then prints them in the Scripts Console
local otherScriptTile = World.GetTile(V2(4, 5), 0);
local variables = Scripts.GetVar(otherScriptTile);

for name, value in pairs(variables) do 
    Print(name .. ": " .. tostring(value));
end

--Prints a specific variable in the Scripts Console
Print("BlastForce: " .. variables["BlastForce"]);

Declaration

Scripts.GetVar(Tile ScriptTile, string Name)

Description

Returns the value of the Name variable from a ScriptTile.

--Gets the Tile object of the other ScriptTile, and gets the value of 
--the editor-exposed "BlastForce" variable then prints it in the Scripts Console
local otherScriptTile = World.GetTile(V2(4, 5), 0);
local force = Scripts.GetVar(otherScriptTile, "BlastForce");

Print(force);

Declaration

Scripts.GetVar(Dictionary<Tile> ScriptTiles)

Description

Returns all the variables from ScriptTiles in the form of a Dictionary of dictionaries.

--Gets the Tile objects of the other ScriptTiles, 
--and gets all the editor-exposed variables from them, 
--then prints them in the Scripts Console
local otherScriptTiles = {World.GetTile(V2(4, 5), 0), World.GetTile(V2(2, 5), 0), World.GetTile(V2(0, 5), 0)};
local scripts = Scripts.GetVar(otherScriptTiles);

for i, scriptVars in ipairs(scripts) do 
    for name, value in pairs(scriptVars) do 
        Print("Script Tile #" .. i .. " " .. name .. ": " .. tostring(value));
    end
end

--Prints a specific variable from a specific ScriptTile in the Scripts Console
Print("Script Tile #2 BlastForce: " .. scripts[2]["BlastForce"]);

Declaration

Scripts.GetVar(Dictionary<Tile> ScriptTiles, string Name)

Description

Returns the values of the Name variable from ScriptTiles in the form of a Dictionary.

--Gets the Tile objects of the other ScriptTiles, 
--and gets all the editor-exposed "BlastForce" variables then prints them in the Scripts Console
local otherScriptTiles = {World.GetTile(V2(4, 5), 0), World.GetTile(V2(2, 5), 0), World.GetTile(V2(0, 5), 0)};
local forces = Scripts.GetVar(otherScriptTiles, "BlastForce");

for i, force in ipairs(forces) do 
    Print("Script Tile #" .. i .. " BlastForce: " .. force);
end

--Prints a specific "BlastForce" from a specific ScriptTile in the Scripts Console
Print("Script Tile #2 BlastForce: " .. forces[2]);

Scripts.CallFunc

Declaration

Scripts.CallFunc(Tile ScriptTile, string FunctionName)

Description

Calls function with name FunctionName on ScriptTile and returns the value returned by it. Function doesn't have to be editor-defined, nor does it have to return anything.

--This function is defined in another script, Score is an editor-defined variable
function GetScore()
    return Score;
end

--Gets the Tile object of the other ScriptTile,
--then calls the "GetScore" function on its Script,
--Then prints the returned value in the Scripts Console
local otherScriptTile = World.GetTile(V2(4, 5), 0);
local score = Scripts.CallFunc(otherScriptTile, "GetScore");

Print(score);

Declaration

Scripts.CallFunc(Tile ScriptTile, string FunctionName, Dictionary Parameters)

Description

Calls function with name FunctionName on ScriptTile with the provided Parameters and returns the value returned by it. Function doesn't have to be editor-defined, nor does it have to return anything.

--These functions are defined in another script, Score is an editor-defined variable
function GetScore()
    return Score;
end

function AddScore(value)
    Score = Score + value;
end

--Gets the Tile object of the other ScriptTile,
--then calls the "AddScore" function on its Script, along with a parameter
--then prints the updated score in the Scripts Console
local otherScriptTile = World.GetTile(V2(4, 5), 0);
local params = {20};
Scripts.CallFunc(otherScriptTile, "AddScore", params);

local score = Scripts.CallFunc(otherScriptTile, "GetScore");

Print(score);

Declaration

Scripts.CallFunc(Dictionary<Tile> ScriptTiles, string FunctionName)

Description

Calls function with name FunctionName on ScriptTiles and returns the values returned by them in the form of a Dictionary. Function doesn't have to be editor-defined, nor does it have to return anything.

--This function is defined in another script, Score is an editor-defined variable
function GetScore()
    return Score;
end

--Gets the Tile objects of the other ScriptTiles,
--then calls the "GetScore" function on their Scripts,
--then prints all the scores in the Scripts Console
local otherScriptTiles = {World.GetTile(V2(4, 5), 0), World.GetTile(V2(2, 5), 0), World.GetTile(V2(0, 5), 0)};
local scores = Scripts.CallFunc(otherScriptTiles, "GetScore");

for i, score in ipairs(scores) do 
    Print("Score #" .. i .. ": " .. score);
end

--Prints the score of the second ScriptTile
Print("Score #2: " .. scores[2]);

Declaration

Scripts.CallFunc(Dictionary<Tile> ScriptTiles, string FunctionName, Dictionary Parameters)

Description

Calls function with name FunctionName on ScriptTiles with the provided Parameters and returns the values returned by them in the form of a Dictionary. Function doesn't have to be editor-defined, nor does it have to return anything.

--These functions are defined in another script, Score is an editor-defined variable
function GetScore()
    return Score;
end

function AddScore(value)
    Score = Score + value;
end

--Gets the Tile objects of the other ScriptTiles,
--then calls the "AddScore" function on their Scripts, along with a parameter
--then prints all the updated scores in the Scripts Console
local otherScriptTiles = {World.GetTile(V2(4, 5), 0), World.GetTile(V2(2, 5), 0), World.GetTile(V2(0, 5), 0)};
local params = {20};
Scripts.CallFunc(otherScriptTiles, "AddScore", params);

local scores = Scripts.CallFunc(otherScriptTiles, "GetScore");

for i, score in ipairs(scores) do 
    Print("Score #" .. i .. ": " .. score);
end

Triggers

Description

This category describes methods used to interface with TriggerZones and ButtonTiles.

Methods

AddOnEnterHandlerAdds a MapAction which runs the provided script function to a ButtonTile or TriggerZoneTile's OnEnter
AddOnLeaveHandlerAdds a MapAction which runs the provided script function to a ButtonTile or TriggerZoneTile's OnLeave
RunOnEnterRuns the target TriggerZone or ButtonTile's OnEnter
RunOnLeaveRuns the target TriggerZone or ButtonTile's OnLeave

Triggers.AddOnEnterHandler

Declaration

Triggers.AddOnEnterHandler(Vector2 Position, number Layer, function Handler)

Description

Creates a special Call Function Script trigger action, that calls the Handler function and then adds it to the TriggerZone or Button tile's OnEnter at Position on Layer. This causes the aforementioned tile types to run the Handler function upon being entered or otherwise triggered.

function GiveBomb(Tile, Player)
    --The Tile parameter is the Tile object for the tile that ran this function
    --So either the Button or TriggerZone tile.

    --The Player parameter is the Player object, if applicable, of the player that triggered the above tiles
    --So for example the player that walked onto the button

    --Its possible for the Player variable to be nil if for the example the OnEnter was triggered by a Timer tile

    if Player ~= nil then
        local container = Powerups();
        container.Bombs = 1;

        Players.SetPowerups(Player, container, Operation.Add);
    end
end

--Adds a handler to the Button which causes it to run the GiveBomb function
--What's important is that the GiveBomb function will be ran on this ScriptTile, and will have access to its variables
local buttonPos = V2(7, 7);
local buttonLayer = 1;
Triggers.AddOnEnterHandler(buttonPos, buttonLayer, GiveBomb);

Declaration

Triggers.AddOnEnterHandler(Vector2 Position, number Layer, bool Relative, Vector2 Origin, function Handler)

Description

Creates a special Call Function Script trigger action, that calls the Handler function and then adds it to the TriggerZone or Button tile's OnEnter at Position on Layer. This causes the aforementioned tile types to run the Handler function upon being entered or otherwise triggered. Position can be relative to Origin if Relative parameter is true.

function GiveBomb(Tile, Player)
    --The Tile parameter is the Tile object for the tile that ran this function
    --So either the Button or TriggerZone tile.

    --The Player parameter is the Player object, if applicable, of the player that triggered the above tiles
    --So for example the player that walked onto the button

    --Its possible for the Player variable to be nil if for the example the OnEnter was triggered by a Timer tile

    if Player ~= nil then
        local container = Powerups();
        container.Bombs = 1;

        Players.SetPowerups(Player, container, Operation.Add);
    end
end

--Adds a handler to the Button which causes it to run the GiveBomb function
--What's important is that the GiveBomb function will be ran on this ScriptTile, and will have access to its variables
local buttonRelativePos = V2(2, 2);
local buttonLayer = 1;
local origin = V2(5, 5);
Triggers.AddOnEnterHandler(buttonRelativePos, buttonLayer, true, origin, GiveBomb);

Declaration

Triggers.AddOnEnterHandler(Dictionary<Vector2> Positions, number Layer, function Handler)

Description

Creates a special Call Function Script trigger action, that calls the Handler function and then adds it to the TriggerZone or Button tiles OnEnter at Positions on Layer. This causes the aforementioned tile types to run the Handler function upon being entered or otherwise triggered. Position can be relative to Origin if Relative parameter is true.

function GiveBomb(Tile, Player)
    --The Tile parameter is the Tile object for the tile that ran this function
    --So either the Button or TriggerZone tile.

    --The Player parameter is the Player object, if applicable, of the player that triggered the above tiles
    --So for example the player that walked onto the button

    --Its possible for the Player variable to be nil if for the example the OnEnter was triggered by a Timer tile

    if Player ~= nil then
        local container = Powerups();
        container.Bombs = 1;

        Players.SetPowerups(Player, container, Operation.Add);
    end
end

--Adds a handler to the Buttons which causes it to run the GiveBomb function
--What's important is that the GiveBomb function will be ran on this ScriptTile, and will have access to its variables
local buttons = {V2(7, 7), V2(7, 5), V2(9, 7), V2(9, 5)};
local buttonLayer = 1;
Triggers.AddOnEnterHandler(buttons, buttonLayer, GiveBomb);

Declaration

Triggers.AddOnEnterHandler(Dictionary<Vector2> Positions, number Layer, bool Relative, Vector2 Origin, function Handler)

Description

Creates a special Call Function Script trigger action, that calls the Handler function and then adds it to the TriggerZone or Button tiles OnEnter at Positions on Layer. This causes the aforementioned tile types to run the Handler function upon being entered or otherwise triggered. Positions can be relative to Origin if Relative parameter is true.

function GiveBomb(Tile, Player)
    --The Tile parameter is the Tile object for the tile that ran this function
    --So either the Button or TriggerZone tile.

    --The Player parameter is the Player object, if applicable, of the player that triggered the above tiles
    --So for example the player that walked onto the button

    --Its possible for the Player variable to be nil if for the example the OnEnter was triggered by a Timer tile

    if Player ~= nil then
        local container = Powerups();
        container.Bombs = 1;

        Players.SetPowerups(Player, container, Operation.Add);
    end
end

--Adds a handler to the Buttons which causes it to run the GiveBomb function
--What's important is that the GiveBomb function will be ran on this ScriptTile, and will have access to its variables
local relativeButtons = {V2(-1, 1), V2(1, 1), V2(-1, -1), V2(1, -1)};
local buttonLayer = 1;
local origin = V2(8, 6);
Triggers.AddOnEnterHandler(relativeButtons, buttonLayer, true, origin, GiveBomb);

Triggers.AddOnLeaveHandler

Declaration

Triggers.AddOnLeaveHandler(Vector2 Position, number Layer, function Handler)

Description

Creates a special Call Function Script trigger action, that calls the Handler function and then adds it to the TriggerZone or Button tile's OnLeave at Position on Layer. This causes the aforementioned tile types to run the Handler function upon being left or otherwise triggered.

function GiveBomb(Tile, Player)
    --The Tile parameter is the Tile object for the tile that ran this function
    --So either the Button or TriggerZone tile.

    --The Player parameter is the Player object, if applicable, of the player that triggered the above tiles
    --So for example the player that walked onto the button

    --Its possible for the Player variable to be nil

    if Player ~= nil then
        local container = Powerups();
        container.Bombs = 1;

        Players.SetPowerups(Player, container, Operation.Add);
    end
end

--Adds a handler to the Button which causes it to run the GiveBomb function
--What's important is that the GiveBomb function will be ran on this ScriptTile, and will have access to its variables
local buttonPos = V2(7, 7);
local buttonLayer = 1;
Triggers.AddOnLeaveHandler(buttonPos, buttonLayer, GiveBomb);

Declaration

Triggers.AddOnLeaveHandler(Vector2 Position, number Layer, bool Relative, Vector2 Origin, function Handler)

Description

Creates a special Call Function Script trigger action, that calls the Handler function and then adds it to the TriggerZone or Button tile's OnLeave at Position on Layer. This causes the aforementioned tile types to run the Handler function upon being left or otherwise triggered. Position can be relative to Origin if Relative parameter is true.

function GiveBomb(Tile, Player)
    --The Tile parameter is the Tile object for the tile that ran this function
    --So either the Button or TriggerZone tile.

    --The Player parameter is the Player object, if applicable, of the player that triggered the above tiles
    --So for example the player that walked onto the button

    --Its possible for the Player variable to be nil

    if Player ~= nil then
        local container = Powerups();
        container.Bombs = 1;

        Players.SetPowerups(Player, container, Operation.Add);
    end
end

--Adds a handler to the Button which causes it to run the GiveBomb function
--What's important is that the GiveBomb function will be ran on this ScriptTile, and will have access to its variables
local buttonRelativePos = V2(2, 2);
local buttonLayer = 1;
local origin = V2(5, 5);
Triggers.AddOnLeaveHandler(buttonRelativePos, buttonLayer, true, origin, GiveBomb);

Declaration

Triggers.AddOnLeaveHandler(Dictionary<Vector2> Positions, number Layer, function Handler)

Description

Creates a special Call Function Script trigger action, that calls the Handler function and then adds it to the TriggerZone or Button tiles OnLeave at Positions on Layer. This causes the aforementioned tile types to run the Handler function upon being left or otherwise triggered. Position can be relative to Origin if Relative parameter is true.

function GiveBomb(Tile, Player)
    --The Tile parameter is the Tile object for the tile that ran this function
    --So either the Button or TriggerZone tile.

    --The Player parameter is the Player object, if applicable, of the player that triggered the above tiles
    --So for example the player that walked onto the button

    --Its possible for the Player variable to be nil

    if Player ~= nil then
        local container = Powerups();
        container.Bombs = 1;

        Players.SetPowerups(Player, container, Operation.Add);
    end
end

--Adds a handler to the Buttons which causes it to run the GiveBomb function
--What's important is that the GiveBomb function will be ran on this ScriptTile, and will have access to its variables
local buttons = {V2(7, 7), V2(7, 5), V2(9, 7), V2(9, 5)};
local buttonLayer = 1;
Triggers.AddOnLeaveHandler(buttons, buttonLayer, GiveBomb);

Declaration

Triggers.AddOnLeaveHandler(Dictionary<Vector2> Positions, number Layer, bool Relative, Vector2 Origin, function Handler)

Description

Creates a special Call Function Script trigger action, that calls the Handler function and then adds it to the TriggerZone or Button tiles OnLeave at Positions on Layer. This causes the aforementioned tile types to run the Handler function upon being left or otherwise triggered. Positions can be relative to Origin if Relative parameter is true.

function GiveBomb(Tile, Player)
    --The Tile parameter is the Tile object for the tile that ran this function
    --So either the Button or TriggerZone tile.

    --The Player parameter is the Player object, if applicable, of the player that triggered the above tiles
    --So for example the player that walked onto the button

    --Its possible for the Player variable to be nil

    if Player ~= nil then
        local container = Powerups();
        container.Bombs = 1;

        Players.SetPowerups(Player, container, Operation.Add);
    end
end

--Adds a handler to the Buttons which causes it to run the GiveBomb function
--What's important is that the GiveBomb function will be ran on this ScriptTile, and will have access to its variables
local relativeButtons = {V2(-1, 1), V2(1, 1), V2(-1, -1), V2(1, -1)};
local buttonLayer = 1;
local origin = V2(8, 6);
Triggers.AddOnLeaveHandler(relativeButtons, buttonLayer, true, origin, GiveBomb);

Triggers.RunOnEnter

Declaration

Triggers.RunOnEnter(Tile Trigger)

Description

Runs OnEnter on the provided Trigger tile, which can be either a TriggerZone or a ButtonTile.

--Gets the tile object for the TriggerZone and runs its OnEnter actions
local targetTrigger = World.GetTile(V2(4, 2), 0);

Triggers.RunOnEnter(targetTrigger);

Declaration

Triggers.RunOnEnter(Tile Trigger, Player Initiator)

Description

Runs OnEnter on the provided Trigger tile, which can be either a TriggerZone or a ButtonTile and passes the Initiator player.

--Gets the tile object for the TriggerZone and runs its OnEnter actions
--with the first player as the initiator
local players = Players.GetAll();
local player = players[1];
local targetTrigger = World.GetTile(V2(4, 2), 0);

Triggers.RunOnEnter(targetTrigger, player);

Declaration

Triggers.RunOnEnter(Dictionary<Tile> Triggers)

Description

Runs OnEnter on the provided Triggers tiles, which can be either TriggerZone or ButtonTiles.

--Gets the tile objects for the TriggerZones and runs their OnEnter actions
local targetTriggers = {World.GetTile(V2(4, 2), 0), World.GetTile(V2(4, 4), 0), World.GetTile(V2(4, 0), 0)};

Triggers.RunOnEnter(targetTriggers);

Declaration

Triggers.RunOnEnter(Dictionary<Tile> Triggers, Player Initiator)

Description

Runs OnEnter on the provided Triggers tiles, which can be either TriggerZone or ButtonTiles and passes the Initiator player.

--Gets the tile objects for the TriggerZones and runs their OnEnter actions
--with the first player as the initiator
local players = Players.GetAll();
local player = players[1];
local targetTriggers = {World.GetTile(V2(4, 2), 0), World.GetTile(V2(4, 4), 0), World.GetTile(V2(4, 0), 0)};

Triggers.RunOnEnter(targetTriggers, player);

Triggers.RunOnLeave

Declaration

Triggers.RunOnLeave(Tile Trigger)

Description

Runs OnLeave on the provided Trigger tile, which can be either a TriggerZone or a ButtonTile.

--Gets the tile object for the TriggerZone and runs its OnLeave actions
local targetTrigger = World.GetTile(V2(4, 2), 0);

Triggers.RunOnLeave(targetTrigger);

Declaration

Triggers.RunORunOnLeavenLeave(Tile Trigger, Player Initiator)

Description

Runs OnLeave on the provided Trigger tile, which can be either a TriggerZone or a ButtonTile and passes the Initiator player.

--Gets the tile object for the TriggerZone and runs its OnLeave actions
--with the first player as the initiator
local players = Players.GetAll();
local player = players[1];
local targetTrigger = World.GetTile(V2(4, 2), 0);

Triggers.RunOnLeave(targetTrigger, player);

Declaration

Triggers.RunOnLeave(Dictionary<Tile> Triggers)

Description

Runs OnLeave on the provided Triggers tiles, which can be either TriggerZone or a ButtonTiles.

--Gets the tile objects for the TriggerZones and runs their OnLeave actions
local targetTriggers = {World.GetTile(V2(4, 2), 0), World.GetTile(V2(4, 4), 0), World.GetTile(V2(4, 0), 0)};

Triggers.RunOnLeave(targetTriggers);

Declaration

Triggers.RunOnLeave(Dictionary<Tile> Triggers, Player Initiator)

Description

Runs OnLeave on the provided Triggers tiles, which can be either TriggerZone or a ButtonTiles and passes the Initiator player.

--Gets the tile objects for the TriggerZones and runs their OnLeave actions
--with the first player as the initiator
local players = Players.GetAll();
local player = players[1];
local targetTriggers = {World.GetTile(V2(4, 2), 0), World.GetTile(V2(4, 4), 0), World.GetTile(V2(4, 0), 0)};

Triggers.RunOnLeave(targetTriggers, player);

Players

Description

Provides methods to retrieve and modify players.

Methods

KillKills a player
SetPowerupsSets player's powerups
GetClosestReturns the closest player
GetFurthestReturns the furthest player
GetRandomReturns a random, alive player
GetReturns the player with the provided ID
GetAllReturns all players
TeleportTeleports a player to a location
LaunchLaunches a player towards a location
SetCameraSets player's camera position and rotation

Players.Kill

Declaration

Players.Kill(number PlayerID)

Description

Kills the player with the specified PlayerID.

--Kills the first player
local allPlayers = Players.GetAll();
Players.Kill(allPlayers[1]);

Declaration

Players.Kill(number PlayerID, TargetPlayer Mode, Vector3 Origin)

Description

Kills the specified player(s), depending on the Mode. If using Mode set to Closest or Furthest, the Origin parameter will be used as the point of reference, otherwise Vector3.zero can be passed.

Check TargetPlayer for all possible Mode values.

--Kills everyone but the player with ID 2
local DontKill = 2;
local Mode = TargetPlayer.Others;
Players.Kill(DontKill, Mode, Vector3.zero);

--Kills the third player
local allPlayers = Players.GetAll();
Players.Kill(allPlayers[3]);

--Kills everyone on the same team as the passed player
Players.Kill(1, TargetPlayer.AllTeamMembers, Vector3.zero);

--Kills random player, the PlayerID parameter is not used
Players.Kill(0, TargetPlayer.Random, Vector3.zero);

--Kills the closest player to the middle of the map, PlayerID is once more not used
local world = World.GetSettings();
Players.Kill(0, TargetPlayer.Closest, V3(world.Width / 2, 1, world.Height / 2));

Declaration

Players.Kill(Dictionary<number> PlayerIDs)

Description

Kills the specified players.

--Retrieves every single player and kills them
local allPlayers = Players.GetAll();
Players.Kill(allPlayers);

--Kills the second and fourth players
Players.Kill({allPlayers[2], allPlayers[4]});

Note

Player IDs must be whole numbers.

Keep in mind the Player IDs aren't necessarily ordered. Players can join and leave in the lobby, potentially several times, increasing their ID, which is why using Players.GetAll is advised if you want to target a player at a specific slot.

You can also pass Player objects instead of numbers as IDs.

Players.SetPowerups

Declaration

Players.SetPowerups(number PlayerID, PowerupContainer Powerups, Operation Operation)

Description

Adds, sets or subtracts powerups for a player, depending on Operation.

Powerups such as Bombs, Blast Radius and Speed are stored as numbers in the Powerups container, so if Operation equals Add, then the provided amount of them will be given to the player. And likewise, if Operation equals Subtract, then the given amount will be taken away from the player. Last but not least, Operation.Set will overwrite the powerups of a player entirely.

In case of powerups such as Shield, Pushing and Jumping, which are booleans, they will be given or taken away depending on whether or not they're set to true. That is, if Operation equals Add, and GrantsShield is set to true, then it will be given to the player. And if Operation is set to Subtract, while GrantsShield is set to true, it will be taken away.

--Retrieves all players
local allPlayers = Players.GetAll();

--Creates a PowerupContainer object, and fills it with values
local powers = Powerups();
powers.BlastRadius = 5;
powers.Bombs = 2;
powers.Speed = 3;
powers.GrantsShield = true;
powers.GrantsPushing = false;
powers.GrantsJumping = true;

--Gives the first player the powerups
Players.SetPowerups(allPlayers[1], powers, Operation.Add);

--Takes the powerups from the first player
Players.SetPowerups(allPlayers[1], powers, Operation.Subtract);

--Sets first player's powerups to the contents of the container
Players.SetPowerups(allPlayers[1], powers, Operation.Set);

Declaration

Players.SetPowerups(number PlayerID, TargetPlayer Mode, Vector3 Origin, PowerupContainer Powerups, Operation Operation)

Description

Adds, sets or subtracts powerups for specific players, depending on Operation and Mode. If using Mode set to Closest or Furthest, the Origin parameter will be used as the point of reference, otherwise Vector3.zero can be passed.

Powerups such as Bombs, Blast Radius and Speed are stored as numbers in the Powerups container, so if Operation equals Add, then the provided amount of them will be given to the player. And likewise, if Operation equals Subtract, then the given amount will be taken away from the player. Last but not least, Operation.Set will overwrite the powerups of a player entirely.

In case of powerups such as Shield, Pushing and Jumping, which are booleans, they will be given or taken away depending on whether or not they're set to true. That is, if Operation equals Add, and GrantsShield is set to true, then it will be given to the player. And if Operation is set to Subtract, while GrantsShield is set to true, it will be taken away.

Check TargetPlayer for all possible Mode values.

--Retrieves all players
local allPlayers = Players.GetAll();

--Creates a PowerupContainer object, and fills it with values
local powers = Powerups();
powers.BlastRadius = 5;
powers.Bombs = 2;
powers.Speed = 3;
powers.GrantsShield = true;
powers.GrantsPushing = false;
powers.GrantsJumping = true;

--Gives everyone but the first player the powerups
Players.SetPowerups(allPlayers[1], TargetPlayer.Others, Vector3.zero, powers, Operation.Add);

--Takes away the powerups from a random player
Players.SetPowerups(0, TargetPlayer.Random, Vector3.zero, powers, Operation.Subtract);

--Sets the second player's powerups
Players.SetPowerups(allPlayers[2], TargetPlayer.Initiator, Vector3.zero, powers, Operation.Set);

Declaration

Players.SetPowerups(Dictionary<number> PlayerIDs, PowerupContainer Powerups, Operation Operation)

Description

Adds, sets or subtracts powerups for specific players, depending on Operation.

Powerups such as Bombs, Blast Radius and Speed are stored as numbers in the Powerups container, so if Operation equals Add, then the provided amount of them will be given to the player. And likewise, if Operation equals Subtract, then the given amount will be taken away from the player. Last but not least, Operation.Set will overwrite the powerups of a player entirely.

In case of powerups such as Shield, Pushing and Jumping, which are booleans, they will be given or taken away depending on whether or not they're set to true. That is, if Operation equals Add, and GrantsShield is set to true, then it will be given to the player. And if Operation is set to Subtract, while GrantsShield is set to true, it will be taken away.

--Retrieves all players
local allPlayers = Players.GetAll();

--Creates a PowerupContainer object, and fills it with values
local powers = Powerups();
powers.BlastRadius = 5;
powers.Bombs = 2;
powers.Speed = 3;
powers.GrantsShield = true;
powers.GrantsPushing = false;
powers.GrantsJumping = true;

--Gives everyone the powerups
Players.SetPowerups(allPlayers, powers, Operation.Add);

--Takes away the powerups specifically from player 2 and 4
Players.SetPowerups({allPlayers[2], allPlayers[4]}, powers, Operation.Add);

--Sets the second player's powerups
Players.SetPowerups(allPlayers[2], powers, Operation.Set);

Note

Player IDs must be whole numbers.

Keep in mind the Player IDs aren't necessarily ordered. Players can join and leave in the lobby, potentially several times, increasing their ID, which is why using Players.GetAll is advised if you want to target a player at a specific slot.

You can also pass Player objects instead of numbers as IDs.

Players.GetClosest

Declaration

Players.GetClosest(Vector3 Position)

Description

Returns the Player object for the closest player relative to Position. If not found, returns a Player object with ID set to -1.

--Prints out the name of the closest player to the position in the Scripts Console
local position = V3(2, 1, 2);
local closestPlayer = Players.GetClosest(position);

Print(closestPlayer.Name);

Declaration

Players.GetClosest(Tile Tile)

Description

Returns the Player object for the closest player relative to Tile. If not found, returns a Player object with ID set to -1.

--Prints out the name of the closest player to the tile in the Scripts Console
local tile = World.GetTile(V2(1, 5), 0);
local closestPlayer = Players.GetClosest(position);

Print(closestPlayer.Name);

Players.GetFurthest

Declaration

Players.GetFurthest(Vector3 Position)

Description

Returns the Player object for the furthest player relative to Position. If not found, returns a Player object with ID set to -1.

--Prints out the name of the furthest player to the position in the Scripts Console
local position = V3(2, 1, 2);
local furthestPlayer = Players.GetFurthest(position);

Print(furthestPlayer.Name);

Declaration

Players.GetFurthest(Tile Tile)

Description

Returns the Player object for the furthest player relative to Tile. If not found, returns a Player object with ID set to -1.

--Prints out the name of the furthest player to the tile in the Scripts Console
local tile = World.GetTile(V2(1, 5), 0);
local furthestPlayer = Players.GetFurthest(position);

Print(furthestPlayer.Name);

Players.GetRandom

Declaration

Players.GetRandom()

Description

Returns the Player object for a random alive player, otherwise returns a Player object with ID set to -1.

--Prints out the name of a random player in the Scripts Console
local randomPlayer = Players.GetRandom();

Print(randomPlayer.Name);

Players.Get

Declaration

Players.Get(number PlayerID)

Description

Retrieves the Player object for the specified PlayerID, containing their name, powerups and other stats, otherwise returns a Player object with ID set to -1 if the player doesn't exist.

--Prints the name of the player with ID 0 in the Scripts Console
local firstPlayer = Players.Get(0);
Print(firstPlayer.Name);

Note

Player IDs must be whole numbers.

Keep in mind the Player IDs aren't necessarily ordered. Players can join and leave in the lobby, potentially several times, increasing their ID, which is why using Players.GetAll is advised if you want to target a player at a specific slot.

Players.GetAll

Declaration

Players.GetAll()

Description

Retrieves the Player objects for all the players, containing their name, powerups and other stats.

--Prints the names of all the players in the Scripts Console
local allPlayers = Players.GetAll();

for i, player in ipairs(allPlayers) do 
    Print(player.Name);
end

Players.Teleport

Declaration

Players.Teleport(number PlayerID, Vector3 Position)

Description

Teleports the specified player to Position

--Teleports the second player to the center of the map
local allPlayers = Players.GetAll();
local world = World.GetSettings();

Players.Teleport(allPlayers[2], V3(world.Width / 2, 1, world.Height / 2));

Declaration

Players.Teleport(number PlayerID, TargetPlayer Mode, Vector3 Origin, Vector3 Position)

Description

Teleports the specified player(s) to Position depending on the Mode. If using Mode set to Closest or Furthest, the Origin parameter will be used as the point of reference, otherwise Vector3.zero can be passed.

Check TargetPlayer for all possible Mode values.

--Teleports other team members of the specified player
local allPlayers = Players.GetAll();
Players.Teleport(allPlayers[1], TargetPlayer.OtherTeamMembers, Vector3.zero, V3(2, 1, 5));

--Teleports the furthest player from the provided point, PlayerID doesn't matter
local point = V3(2, 1, 3);
Players.Teleport(0, TargetPlayer.Furthest, point, V3(2, 1, 5));

Declaration

Players.Teleport(Dictionary<number> PlayerIDs, Vector3 Position)

Description

Teleports the specified players to Position.

--Teleports everyone to a certain position
local allPlayers = Players.GetAll();
Players.Teleport(allPlayers, V3(2, 1, 5));

--Teleports only the players that have enough bombs
local toTeleport = {};
for i, player in ipairs(allPlayers) do 
    if player.BombsTotal > 5 then
        table.insert(toTeleport, player);
    end
end

Players.Teleport(toTeleport, V3(2, 1, 5));

--Teleports only the first two players
Players.Teleport({allPlayers[1], allPlayers[2]}, V3(2, 1, 5));

Note

Player IDs must be whole numbers.

Keep in mind the Player IDs aren't necessarily ordered. Players can join and leave in the lobby, potentially several times, increasing their ID, which is why using Players.GetAll is advised if you want to target a player at a specific slot.

You can also pass Player objects instead of numbers as IDs.

Players.Launch

Declaration

Players.Launch(number PlayerID, Vector3 Position, number Speed)

Description

Launches the specified player towards Position with Speed. Launching works similar to the Launcher tile.

--Launches the second player towards the center of the map
local allPlayers = Players.GetAll();
local world = World.GetSettings();

Players.Launch(allPlayers[2], V3(world.Width / 2, 1, world.Height / 2), 1);

Declaration

Players.Launch(number PlayerID, TargetPlayer Mode, Vector3 Origin, Vector3 Position, number Speed)

Description

Launches the specified player(s) towards Position depending on the Mode with Speed. If using Mode set to Closest or Furthest, the Origin parameter will be used as the point of reference, otherwise Vector3.zero can be passed. Launching works similar to the Launcher tile.

Check TargetPlayer for all possible Mode values.

--Launches other team members of the specified player
local allPlayers = Players.GetAll();
Players.Launch(allPlayers[1], TargetPlayer.OtherTeamMembers, Vector3.zero, V3(2, 1, 5), 1);

--Launches the furthest player from the provided point, PlayerID doesn't matter
local point = V3(2, 1, 3);
Players.Launch(0, TargetPlayer.Furthest, point, V3(2, 1, 5), 1);

Declaration

Players.Launch(Dictionary<number> PlayerIDs, Vector3 Position, number Speed)

Description

Launches the specified players towards Position with Speed. Launching works similar to the Launcher tile.

--Launches everyone towards a certain position
local allPlayers = Players.GetAll();
Players.Launch(allPlayers, V3(2, 1, 5), 1);

--Launches only the players that have enough bombs
local toTeleport = {};
for i, player in ipairs(allPlayers) do 
    if player.BombsTotal > 5 then
        table.insert(toTeleport, player);
    end
end

Players.Launch(toTeleport, V3(2, 1, 5), 1);

--Launches only the first two players
Players.Launch({allPlayers[1], allPlayers[2]}, V3(2, 1, 5), 1);

Note

Player IDs must be whole numbers.

Keep in mind the Player IDs aren't necessarily ordered. Players can join and leave in the lobby, potentially several times, increasing their ID, which is why using Players.GetAll is advised if you want to target a player at a specific slot.

You can also pass Player objects instead of numbers as IDs.

Players.SetCamera

Declaration

Players.SetCamera(number PlayerID, Vector3 PositionOffset, Vector3 RotationOffset)

Description

Sets position and rotation camera offsets respectively to PositionOffset and RotationOffset for a specific player.

--Retrieves all players
local allPlayers = Players.GetAll();

--Sets the first player's camera
Players.SetCamera(allPlayers[1], V3(0, 6, 7.6), V3(25, 0, 0));

Declaration

Players.SetCamera(number PlayerID, TargetPlayer Mode, Vector3 Origin, Vector3 PositionOffset, Vector3 RotationOffset)

Description

Sets position and rotation camera offsets respectively to PositionOffset and RotationOffset for specific players, depending on the Mode. If using Mode set to Closest or Furthest, the Origin parameter will be used as the point of reference, otherwise Vector3.zero can be passed.

Check TargetPlayer for all possible Mode values.

--Retrieves all players
local allPlayers = Players.GetAll();

--Sets the camera for all the other teams than player 1's team
Players.SetCamera(allPlayers[1], TargetPlayer.OtherTeams, Vector3.zero, V3(0, 6, 7.6), V3(25, 0, 0));

--Sets the camera for everyone else than player 2
Players.SetCamera(allPlayers[2], TargetPlayer.Others, Vector3.zero, V3(0, 6, 7.6), V3(25, 0, 0));

--Sets the camera for the furthest player to the provided position
Players.SetCamera(0, TargetPlayer.Furthest, V3(2, 1, 2), V3(0, 6, 7.6), V3(25, 0, 0));

Declaration

Players.SetCamera(Dictionary<number> PlayerIDs, Vector3 PositionOffset, Vector3 RotationOffset)

Description

Sets position and rotation camera offsets respectively to PositionOffset and RotationOffset for specific players.

--Retrieves all players
local allPlayers = Players.GetAll();

--Sets the camera for everyone
Players.SetCamera(allPlayers, V3(0, 6, 7.6), V3(25, 0, 0));

--Sets different camera offsets for player 1 and 3 specifically
Players.SetCamera({allPlayers[1], allPlayers[3]}, V3(0.5, 0, 14), V3(0, 180, 0));

Note

Player IDs must be whole numbers.

Keep in mind the Player IDs aren't necessarily ordered. Players can join and leave in the lobby, potentially several times, increasing their ID, which is why using Players.GetAll is advised if you want to target a player at a specific slot.

You can also pass Player objects instead of numbers as IDs.

If there are several players playing on the same device, and the camera gets set for one of them, it will set the camera for every player on that device.

This does not affect the FPS gamemode camera.

Color

Object that represents colors using RGBA.

Each component is a number from range 0 to 255.

Constructors

Color(number R, number G, number B, number A)

Properties

number rRed component of the color
number gGreen component of the color
number bBlue component of the color
number aAlpha component of the color

Examples

local red = Color(255, 0, 0, 255);
local green = Color(0, 255, 0, 255);
local blue = Color(0, 0, 255, 255);

Vector2

Object that represents a 2D position.

Constructors

V2(number X, number Y)

Properties

number xX component of the vector
number yY component of the vector

Static properties

Vector2 zeroShorthand for writing V2(0, 0, 0)

Examples

local position = V2(10, 5);

local zero = Vector2.zero;

Vector3

Object that represents a 3D position.

Constructors

V3(number X, number Y, number Z)

Properties

number xX component of the vector
number yY component of the vector
number zZ component of the vector

Static properties

Vector3 zeroShorthand for writing V3(0, 0, 0)

Examples

local position = V3(3, 2, 5);

local zero = Vector3.zero;

Vector4

Object that represents a four-dimensional vector.

Constructors

V4(number X, number Y, number Y, number W)

Properties

xX component of the vector
yY component of the vector
zZ component of the vector
wW component of the vector

Static properties

Vector4 zeroShorthand for writing V4(0, 0, 0, 0)

Examples

local vector = V4(2, 2, 3, 1);

local zero = Vector4.zero;

TileLocation

Object that represents a position of a tile, relative or not.

Constructors

TileLocation(number X, number Y, number Layer, bool RelativePosition)

Properties

number XX position of the tile
number YY position of the tile
number LayerLayer on which the tile is located
bool RelativePositionWhether relative positioning is used

Examples

local tileLoc = TileLocation(2, 2, 0, false);

Player

Object that represents a player in the game.

Properties

number IDID of the player
string NameName of the player
bool KilledWhether the player is dead or not
Vector3 PositionPlayer's position in the game world
number SpeedPlayer's speed power value
number BombPowerPlayer's blast radius power value
number BombsPlayer's current bomb count (excludes placed bombs)
number BombsTotalPlayer's current bomb count (includes placed bombs)
bool HasPushingWhether the player has the Pushing powerup
bool HasJumpingWhether the player has the Jumping powerup
ShieldState ShieldStateState of the player's shield
number WinsHow many rounds were won by that player
number KillsHow many kills that player has
number DeathsHow many times that player died
Team TeamThe team this player is on

Tile

Object that represents a tile in the game.

Properties

Vector2 PositionPosition of the tile on the world grid
TileType TypeType of the tile
number LayerLayer this tile is on
number HeightHeight of the tile
number ExtendCountExtend Count of the tile
Dictionary PropertiesProperties of the tile

World

Object that represents the world, or otherwise known as map or level in the game.

Properties

string NameName of the world
string AuthorName of the author of the world
number WidthWidth of the world
number HeightHeight of the world
bool AutoFloorPlacementWhether automatic floor placement is enabled
string EnvironmentSeedThe environment seed of the world, used for generating the environment around the map
number XCameraOffsetThe X position offset of the camera
number YCameraOffsetThe Y position offset of the camera
number ZCameraOffsetThe Z position offset of the camera
number XRotationOffsetThe X rotation offset of the camera
number YRotationOffsetThe Y rotation offset of the camera
number ZRotationOffsetThe Z rotation offset of the camera
number ThemeIndexThe index of the theme of the world

TargetPlayer

Enumeration that represents the targeting mode in various functions of this API. Usually passed along with the ID of the target player, and a Vector3 as a point of reference.

Values

Initiator [0]Targets the target player
Everyone [1]Targets everyone
Others [2]Targets everyone but the target player
Random [3]Targets a random player
Closest [4]Targets the closest player to the point of reference
Furthest [5]Targets the furthest player to the point of reference
AllTeamMembers [6]Targets all the team members of the target player, target player included
OtherTeamMembers [7]Targets all the team members of the target player, target player excluded
OtherTeams [8]Targets all the other teams, which target player is not part of

Examples

local initiator = TargetPlayer.Initiator;

local others = TargetPlayer.Others;

local everyone = TargetPlayer.Everyone;

Operation

Enumeration that represents the operation mode in various functions of this API. Usually used when adding, subtracting or setting values.

Values

Add [0]Indicates that the values should be added
Subtract [1]Indicates that the values should be subtracted
Set [2]Indicates that the values should be set

Examples

local add = Operation.Add;

local subtract = Operation.Subtract;

local set = Operation.Set;

TileType

Enumeration that represents the different tile types in the game.

Values

Air [0]The Air tile
Floor [1]The Floor tile
Spawnpoint [2]The Spawnpoint tile
Wall [3]The Wall tile
SDWall [4]The Sudden Death Wall tile
Crate [5]The Crate tile
MetalCrate [6]The Metal Crate tile
Teleporter [7]The Teleporter tile
Spikes [8]The Spikes tile
CountBomb [9]The Count Bomb tile
CrateBomb [10]The Crate Bomb tile
LandMine [11]The Land Mine tile
PowerupTile [12]The Powerup tile
InfoTile [13]The Info tile
Fuse [14]The Fuse tile
BombField [15]The Bomb Field tile
Slope [16]The Slope tile
Pusher [17]The Pusher tile
Launcher [18]The Launcher tile
Button [19]The Button tile
TriggerZone [20]The Trigger Zone tile
Timer [21]The Timer tile
Symbol [22]The Symbol tile
Text [23]The Text tile
Ice [24]The Ice tile
Collectible [25]The Collectible tile
CustomWall [26]The Custom Wall tile
Laser [27]The Laser tile
LaserMirror [28]The Laser Mirror tile
ScriptTile [29]The Script tile
LaserBarrier [30]The Laser Barrier tile
LaserRelay [31]The Laser Relay tile
LaserReceiver [32]The Laser Receiver tile
Breakable [33]The Breakable tile
Light [34]The Light tile
CornerSlope [35]The Corner Slope tile

Examples

local crateType = TileType.Crate;

local laserTile = TileType.Laser;

local pusherTile = TileType.Pusher;

Team

Enumeration that represents the different teams in the game.

Values

Neutral [0]The Neutral team
Red [1]The Red team
Blue [2]The Blue team
Green [3]The Green team
Yellow [4]The Yellow team
Orange [5]The Orange team
Purple [6]The Purple team
Beige [7]The Beige team
Coral [8]The Coral team

Examples

local neutralTeam = Team.Neutral;

local coralTeam = Team.Coral;

local orangeTeam = Team.Orange;

TeamColors

Enumeration that represents the different team priority values that can be set on a Spawnpoint tile.

Values

None [0]No team priority
TeamA [1]Team A priority
TeamB [2]Team B priority
TeamC [3]Team C priority
TeamD [4]Team D priority
TeamE [5]Team E priority
TeamF [6]Team F priority
TeamG [7]Team G priority
TeamH [8]Team H priority
TeamI [9]Team I priority
TeamJ [10]Team J priority
TeamK [11]Team K priority
TeamL [12]Team L priority
TeamM [13]Team M priority
TeamN [14]Team N priority
TeamO [15]Team O priority
Neutral [64]Neutral team priority
Red [65]Red team priority
Blue [66]Blue team priority
Green [67]Green team priority
Yellow [68]Yellow team priority
Orange [69]Orange team priority
Purple [70]Purple team priority
Beige [71]Beige team priority
Coral [72]Coral team priority

Examples

local neutralTeam = TeamColors.Neutral;

local coralTeam = TeamColors.Coral;

local orangeTeam = TeamColors.Orange;

Sprite

Object that represents a 2D sprite.

Constructors

Sprite(string ID, Color Color)

Properties

string IDID of the sprite
Color ColorColor of the sprite

Examples

local blankSprite = Sprite("Blank", Color(255, 255, 255, 255));

local bombSprite = Sprite("Bomb", Color(255, 255, 255, 255));

local redTriangle = Sprite("Shape Triangle", Color(255, 0, 0, 255));

ShieldState

Enumeration that represents the different states of the player's shield.

Values

Active [0]The shield is active
Damaged [1]The shield is damaged, and about to enter inactive state
Inactive [2]The shield is inactive

Examples

local activeShieldState = ShieldState.Active;

local damagedShieldState = ShieldState.Damaged;

local inactiveShieldState = ShieldState.Inactive;

PusherRotationStyle

Enumeration that represents the different rotation styles for the Pusher tile.

Values

None [0]Pusher doesn't rotate
Clockwise [1]Pusher rotates clockwise
CounterClockwise [2]Pusher rotates counter clockwise
Random [3]Pusher rotates randomly

Examples

local noneRotation = PusherRotationStyle.None;

local clockwiseRotation = PusherRotationStyle.Clockwise;

local randomRotation = PusherRotationStyle.Random;

LandMineRepeatingStyle

Enumeration that represents the different repeating styles for the LandMine tile.

Values

None [0]LandMine expires after being triggered once
Step [1]LandMine can be triggered several times by stepping on it
Repeat [2]LandMine explodes several times in a row with a delay

Examples

local noRepeat = LandMineRepeatingStyle.None;

local stepRepeat = LandMineRepeatingStyle.Step;

local repeatRepeat = LandMineRepeatingStyle.Repeat;

Direction

Enumeration that represents the different directions.

Values

Up [0]Value indicating up
Down [1]Value indicating down
Left [2]Value indicating left
Right [3]Value indicating right

Examples

local upDir = Direction.Up;

local leftDir = Direction.Left;

local rightDir = Direction.Right;

TimerTrigger

Enumeration that represents the different events that can trigger a Timer tile.

Values

None [0]Timer isn't fired automatically
OnStart [1]Timer is fired when the round starts
OnSuddenDeath [2]Timer is fired when Sudden Death begins
OnRoundEnd [3]Timer is fired when the round ends

Examples

local noneTrigger = TimerTrigger.None;

local onStartTrigger = TimerTrigger.OnStart;

local suddenDeathTrigger = TimerTrigger.OnSuddenDeath;

PowerupContainer

Object that is a container for powerups. Used with the SetPowerups function.

Constructors

Powerups()

Properties

number BlastRadiusHow much Blast Radius should be given
number BombsHow many Bombs should be given
number SpeedHow much Speed should be given
bool GrantsShieldWhether Shield should be granted
bool GrantsPushingWhether Pushing should be granted
bool GrantsJumpingWhether Jumping should be granted

Examples

local container = Powerups();
container.BlastRadius = 2;
container.Bombs = 5;
container.Speed = 1;
container.GrantsShield = true;
container.GrantsPushing = true;
container.GrantsJumping = false;

ColorGradient

Object that represents a color gradient.

Each color gradient consists of several colors and alphas (max is 8 for both).

The Time property on the keys has to be between 0 and 1.

Alpha is in the range of 0 to 255.

Constructors

ColorGradient()

Functions

AddColor(ColorKey Key)Adds a color key to the gradient (max is 8)
AddColor(Color Color, number Time)Creates a color key with the given parameters and adds it (max is 8)
ColorKey GetColor(number Index)Returns the color key on the given Index
RemoveColor(number Index)Removes the color key on the given Index
AddAlpha(AlphaKey Key)Adds an alpha key to the gradient (max is 8)
AddAlpha([number Alpha, number Time)Creates an alpha key with the given parameters and adds it (max is 8)
AlphaKey GetAlpha(number Index)Returns the alpha key on the given Index
RemoveAlpha(number Index)Removes the alpha key on the given Index

Examples

local colorGradient = ColorGradient();
colorGradient.AddColor(Color(252, 186, 3, 255), 0);
colorGradient.AddColor(Color(45, 252, 3, 255), 0.5);
colorGradient.AddColor(Color(98, 3, 252, 255), 1);
colorGradient.AddAlpha(255, 0);
colorGradient.AddAlpha(255, 1);

ColorKey

Object that represents a color key in a gradient, that consists of a Color and a Time property.

The Time property has to be between 0 and 1.

Constructors

ColorKey(Color Color, number Time)

Functions

Color ColorThe color in this key
number TimeThe time in this key

Examples

local aquaColorKey = ColorKey(Color(0, 255, 255, 255), 0);

AlphaKey

Object that represents an alpha key in a gradient, that consists of an Alpha and a Time property.

The Alpha property has to be between 0 and 255. The Time property has to be between 0 and 1.

Constructors

AlphaKey(number Alpha, number Time)

Functions

number AlphaThe alpha in this key
number TimeThe time in this key

Examples

local alphaKey = AlphaKey(255, 0);

GameMode

Enumeration that represents the different game modes in the game.

Values

Standard [0]The standard topdown game mode
FPS [1]The First Person game mode
Runner [2]The Runner game mode
GoldRush [3]The Gold Rush game mode
Freeroam [4]The Freeroam game mode

Examples

local standardMode = GameMode.Standard;

local runnerMode = GameMode.Runner;

local goldRushMode = GameMode.GoldRush;

GameSheme

Object that represents the match settings, or otherwise known as game scheme or rules.

Properties

string NameName of the scheme
number StartingBombsNumber of starting Bombs
number StartingPowerNumber of starting Blast Radius
number StartingSpeedNumber of starting Speed
bool StartShieldedWhether players start with the Shield powerup
bool StartPushingWhether players start with the Pushing powerup
bool StartJumpingWhether players start with the Jumping powerup
bool PreservePowerupsWhether preserving powerups is enabled
bool PreserveBombsWhether preserving Bombs is enabled
bool PreserveBlastRadiusWhether preserving Blast Radius is enabled
bool PreserveSpeedWhether preserving Speed is enabled
bool PreserveShieldWhether preserving Shield is enabled
bool PreservePushingWhether preserving Pushing is enabled
bool PreserveJumpingWhether preserving Jumping is enabled
number DropChanceThe chance to drop a powerup from a crate, from 0 to 100
number BombsDropRateDrop rate of the Bomb powerup, from 0 to 5
number PowerDropRateDrop rate of the Blast Radius powerup, from 0 to 5
number SpeedDropRateDrop rate of the Speed powerup, from 0 to 5
number ShieldDropRateDrop rate of the Shield powerup, from 0 to 5
number PushDropRateDrop rate of the Pushing powerup, from 0 to 5
number JumpDropRateDrop rate of the Jumping powerup, from 0 to 5
bool SixWayExplosionsWhether six way explosions are enabled
bool ImpactBombsWhether bombs explode on impact is enabled
bool DarknessWhether darkness is enabled
number RoundsNumber of rounds to be played
number SuddenDeathMinutesMinutes until Sudden Death starts
GameMode GameModeThe selected game mode

LightType

Enumeration that represents the different light types that can be used on the Light tile.

Values

Spot [0]The light is a cone-shaped spot light
Directional [1]The light is a directional light
Point [2]The light is a point light

Examples

local spotLight = LightType.Spot;

local directionalLight = LightType.Directional;

local pointLight = LightType.Point;

LightModel

Enumeration that represents the different light models that can be used on the Light tile.

Values

None [0]The light model is hidden, but light is still emitted
Modern [1]The modern light model

Examples

local noneLightModel = LightModel.None;

local modernLightModel = LightModel.Modern;

Air

Properties

This tile has no editable properties.

Floor

Properties

This tile has no editable properties.

SpawnPoint

Properties

TeamColors TeamWhich team should have the priority to be spawned here
number FillOrderSpawning priority. SpawnPoints with a lower value are picked first
bool FillOrderOverTeamsWhether FillOrder matters more than the Team selected

Wall

Properties

This tile has no editable properties.

SDWall

Properties

This tile has no editable properties.

Crate

Properties

This tile has no editable properties.

MetalCrate

Properties

This tile has no editable properties.

Teleporter

Properties

TileLocation TargetLocThe tile location of the other teleporter to teleport to
Color ColorColor of the teleporter

Actions

SyncChanges the color of the other teleporter at TargetLoc to the same one as this one, and makes it target it as well

Spikes

Properties

number ONDurationFor how many seconds the spikes should remain on
number OFFDurationFor how many seconds the spikes should remain off
number InitialDelayHow long it takes for spikes to start working

CountBomb

Properties

number DelayHow long until the bomb goes off after stepping on the plate
number BlastRadiusThe power of the explosion
Direction DirectionWhich direction the tile is facing

Actions

DetonateBlows up the CountBomb instantly
TriggerTriggers the Delay before explosion

CrateBomb

Properties

number BlastRadiusThe power of the explosion

Actions

DetonateBlows up the CrateBomb instantly

LandMine

Properties

number DelayHow long it takes for the LandMine to blow up
number BlastRadiusThe power of the explosion
LandMineRepeatingStyle RepeatingStyleThe repeating style of the mine
number RepeatDelayHow long it takes for the LandMine to be retriggeable
number RepeatTimesHow many times the LandMine can be retriggered

Actions

DetonateBlows up the LandMine instantly
TriggerTriggers the Delay before explosion

PowerupTile

Properties

number ExpirationHow much time in seconds until the powerup expires. Set to 0 to disable expiration
number BlastRadiusHow much Blast Radius this powerup should give
number BombsHow many Bombs this powerup should give
number SpeedHow much Speed this powerup should give
bool GrantsShieldWhether this powerup should grant Shield
bool GrantsPushingWhether this powerup should grant Pushing
bool GrantsJumpingWhether this powerup should grant Jumping

InfoTile

Properties

string TitleThe title of the InfoTile
string ContentThe content of the InfoTile

Fuse

Properties

Color ColorColor of the Fuse
bool IgnitesWhether the Fuse should be ignited by explosions
bool ExplosionOnIgniteWhether the Fuse should spawn explosions when ignited
bool OneUseWhether the Fuse should be destroyed after being ignited once

BombField

Properties

This tile has no editable properties.

Slope

Properties

Direction DirectionDirection in which this tile is facing

Pusher

Properties

Direction DirectionDirection in which this tile is facing
bool PushesBombWhether this Pusher should push bombs
bool ReignitesBombWhether this Pusher should reignite bombs (reset their timers so they don't explode)
bool InvertsBombMovementWhether this Pusher should invert the movement of bombs
Color ColorThe color of the Pusher
PusherRotationStyle RotationStyleThe rotation style of the Pusher
number RotationRateHow much time in seconds before the Pusher rotates

Launcher

Properties

TileLocation TargetLocThe target TileLocation of the Launcher tile
Color ColorThe color of the Launcher
number SpeedHow fast the launched objects should be

Button

Properties

number MaxCallsHow many times this button can be triggered
number SeparateMaxCallsWhether players should have separate MaxCalls
Color RepeatingStyleThe color of this Button
bool PlayerTriggerWhether players can trigger this button
bool BombTriggerWhether bombs can trigger this button
bool ExplosionTriggerWhether explosions can trigger this button
bool TriggerExplosionTriggerWhether explosions spawned by triggers or scripts can trigger this button

Actions

ResetStops the Button if its currently executing any actions and resets how many times it has been triggered

TriggerZone

Properties

Vector3 PositionOffsetPosition offset of the TriggerZone
number SizeXThe size of the TriggerZone on the X axis
number SizeYThe size of the TriggerZone on the Y axis
number SizeZThe size of the TriggerZone on the Z axis
number MaxCallsHow many times this TriggerZone can be triggered
number SeparateMaxCallsWhether players should have separate MaxCalls
bool PlayerTriggerWhether players can trigger this TriggerZone
bool BombTriggerWhether bombs can trigger this TriggerZone
bool ExplosionTriggerWhether explosions can trigger this TriggerZone
bool TriggerExplosionTriggerWhether explosions spawned by triggers or scripts can trigger this TriggerZone
bool RunOnEveryEnterLeaveWhether the OnEnter and OnLeave actions should be ran every single time a player enters or leaves the TriggerZone, or only when a player enters when there are no other players inside it, or when the last player leaves
bool DontApplyPositionOffsetSpecial, made to be passed using ModTile. Prevents the TriggerZone from moving to its original position upon using ModTile

Actions

ResetStops the TriggerZone if its currently executing any actions and resets how many times it has been triggered

Timer

Properties

number MaxCallsHow many times this Timer can be triggered
number DelayThe Delay until the Timer runs OnEnter on the target TriggerZone
TileLocation TargetLocThe tile location of the target TriggerZone tile
TimerTrigger TriggerThe game event that should trigger this Timer automatically

Actions

StartTriggers the Timer
ResetStops the Timer if its currently running and resets how many times it has been triggered

Symbol

Properties

Sprite SpriteThe Sprite this Symbol tile displays
Vector2 ScaleScale of the Sprite
Vector3 PositionOffsetPosition offset of the Sprite
Vector3 RotationOffsetRotation offset of the Sprite
number OrderInLayerThe order in layer of the Sprite. The higher the number, the closer the Sprite looks to the camera

Text

Properties

string TextThe Text this Text tile displays
Vector3 PositionOffsetPosition offset of the Text
Vector3 RotationOffsetRotation offset of the Text
number OrderInLayerThe order in layer of the Text. The higher the number, the closer the Text looks to the camera

Ice

Properties

This tile has no editable properties.

Collectible

Properties

This tile has no editable properties.

CustomWall

Properties

bool VisibleWhether this CustomWall is visible
bool CollidableWhether this CustomWall can be collided with

Laser

Properties

bool EnabledWhether the Laser emitter is enabled
ColorGradient LaserGradientThe color gradient of the Laser
Color ColorThe color gradient of the orb around the Laser emitter
number ThicknessThickness of the Laser
number RangeRange of the Laser
Vector3 PositionOffsetThe position offset of the Laser emitter
Vector3 RotationOffsetThe rotation offset of the Laser emitter
Vector3 ConstantRotationThe speed of constant rotation on all three axes
bool DontApplyPositionOffsetSpecial, made to be passed using ModTile. Prevents the tile from moving to its original position upon using ModTile
bool DontApplyRotationOffsetSpecial, made to be passed using ModTile. Prevents the tile from rotating to its original rotation upon using ModTile

LaserRelay

Properties

Color ColorThe color of the LaserRelay
number LasersCountHow many lasers this relay outputs
number AngleBetweenLasersThe angle between outputted lasers
Vector3 PositionOffsetThe position offset of the LaserRelay
Vector3 RotationOffsetThe rotation offset of the LaserRelay
Vector3 ConstantRotationThe speed of constant rotation on all three axes
bool DontApplyPositionOffsetSpecial, made to be passed using ModTile. Prevents the tile from moving to its original position upon using ModTile
bool DontApplyRotationOffsetSpecial, made to be passed using ModTile. Prevents the tile from rotating to its original rotation upon using ModTile

LaserReceiver

Properties

Color ColorThe color of the LaserReceiver when it is inactive
Color ActiveColorThe color of the LaserReceiver when it is active
number RequiredLaserCountHow many lasers are required to activate this receiver
bool StopLaserWhether this LaserReceiver prevents the laser from travelling further
number MaxCallsHow many times this receiver can be activated
Vector3 PositionOffsetThe position offset of the LaserReceiver
Vector3 RotationOffsetThe rotation offset of the LaserReceiver
Vector3 ConstantRotationThe speed of constant rotation on all three axes
bool DontApplyPositionOffsetSpecial, made to be passed using ModTile. Prevents the tile from moving to its original position upon using ModTile
bool DontApplyRotationOffsetSpecial, made to be passed using ModTile. Prevents the tile from rotating to its original rotation upon using ModTile

Actions

ResetStops the LaserReceiver if its currently executing any actions and resets how many times it has been activated

LaserMirror

Properties

Color ColorThe color of the LaserMirror
Vector3 PositionOffsetThe position offset of the LaserMirror
Vector3 RotationOffsetThe rotation offset of the LaserMirror
Vector3 ConstantRotationThe speed of constant rotation on all three axes
bool EnableStandWhether the stand should be enabled
bool DontApplyPositionOffsetSpecial, made to be passed using ModTile. Prevents the tile from moving to its original position upon using ModTile
bool DontApplyRotationOffsetSpecial, made to be passed using ModTile. Prevents the tile from rotating to its original rotation upon using ModTile

ScriptTile

Properties

This tile has no editable properties.

LaserBarrier

Properties

This tile has no editable properties.

Breakable

Properties

number MaxHealthThe max health of this Breakable tile
number HealthThe starting health of this Breakable tile
number CurrentHealthThe current health of this Breakable tile
number ExplosionDamageHow much damage an explosion does to this Breakable tile
number LaserDamageHow much damage a laser does to this Breakable tile
bool SpawnRandomPowerupWhether this Breakable tile has the chance to spawn a Powerup, just like Crates do
Color ColorThe color of this Breakable tile
bool DontApplyHealthSpecial, made to be passed using ModTile. Prevents the tile from resetting its Health value upon using ModTile

Light

Properties

bool EnabledWhether this Light tile is currently emitting light
LightType TypeThe type of this Light. Default is Point
LightModel ModelThe 3D model of this Light. Default is Modern
Color ColorThe color of the emitted light
number IntensityThe intensity of the emitted light
number RangeThe range of the emitted light, only used when Type is set to Spot and Point
number OuterSpotAngleThe outer angle in degrees, at the base of a Spot light's cone. Only used when Type is set to Spot
number InnerSpotAngleThe inner angle in degrees, at the base of a Spot light's cone. Only used when Type is set to Spot
Vector3 PositionOffsetThe position offset of the Light
Vector3 RotationOffsetThe rotation offset of the Light
Vector3 ConstantRotationThe speed of constant rotation on all three axes
bool DontApplyPositionOffsetSpecial, made to be passed using ModTile. Prevents the tile from moving to its original position upon using ModTile
bool DontApplyRotationOffsetSpecial, made to be passed using ModTile. Prevents the tile from rotating to its original rotation upon using ModTile

CornerSlope

Properties

Direction DirectionDirection in which this tile is facing

Sprites

These are all the available Sprite IDs that can be used on Symbol tiles.

Blank
Bomb
Cross
Exclamation Mark
Info
Line
Line Arrow
Line Connector
Line Corner
Line Corner Curved
Line Intersection
Powerup Blast Radius
Powerup Bomb
Powerup Kill
Powerup Mixed
Powerup Push
Powerup Shield
Powerup Speed
Shape Circle
Shape Circle Filled
Shape Square
Shape Square Filled
Shape Triangle
Shape Triangle Filled
Symbol Heart
Symbol Star
Wall