Scripting help
Every word
Every word Splat Script has, and which scripts can use it.
These are all the words Splat Script has. The Who column shows which scripts can use a word, and a word with no symbol works in every script. Numbers in the examples are yours to change.
Triggers
| Who | Word | What it does |
|---|---|---|
| Every script | when "alarm" | When any script sets off a trigger with this name, like trigger “alarm”. Read what it brought with trigger @count, trigger 1st value, or trigger who for who set it off. |
when I start | When the level starts, and when I come back after being beaten. | |
when the {Hero} steps on me | When the hero lands on me, and again each time they walk onto another of my blocks. {trigger id} is the block they're on. | |
when the {Hero} steps off me | When the hero isn't standing on any of my blocks any more. {trigger id} is the last block they were on. | |
when I get hit from below | When the hero jumps up and bumps their head on one of my blocks. {trigger id} is that block. | |
when I get hit | When the hero's attack reaches me (or one of my blocks), once a swing. Nothing else happens to me unless my script says so. For blocks, {trigger id} is the block hit. | |
when the {Hero} reaches me | When the hero reaches me. A goal waits for this rule to finish, 5 seconds at most, before the level is won. | |
when I touch the {Hero} | When the hero and I start touching. Harmful flyers hurt them too; say “I am harmless” to only hear it. | |
when the {Hero} goes through me | When the hero goes in through me. | |
when I am opened | When the hero opens me with my key. | |
when the {Hero} picks me up | When the hero picks me up. My script stops after this rule: I'm carried now. | |
when the {Hero} bounces on me | When I launch the hero into the air (OBJECT-SCRIPTS.SCRATCH.md). | |
when I see the {Hero} within 5 blocks | When the hero comes into view. Without “within”, my Notice distance in Object settings is used. | |
when I lose the {Hero} | When the hero gets out of view. | |
when the {Hero} swings at me | Just before the hero's swing would hit me. Good for “dodge”. | |
when I get hit | When the hero hurts me and I'm not beaten yet. | |
when the {Hero} touches me | When I bump into the hero and hurt them. | |
| Every script | every 3 seconds | Again and again, this often, counted from when the script starts. “every 2 to 4 seconds” picks a new time between them each time, so characters don't keep step with each other. |
| Every script | after 3 seconds | Once, this long after I start. |
when I reach an edge | When my next step would walk off the floor I'm on. | |
when I bump into a wall | When I walk into a wall, or the side of the level. | |
when I land | When I come down on a floor after a jump or a fall. | |
when the {Hero} talks to me | When the {Hero} talks to me. | |
when the {Hero} makes an offer | When the hero picks things to give me with Make offer. Count them with “… in the offer”, then “accept the offer” or “turn down the offer”. One I don't answer is turned down when this rule ends. | |
when the {Hero} comes near | When the hero walks up close: 3 blocks, unless you say how near. | |
when the {Hero} walks away | When the hero goes more than 3 blocks away again. | |
| Every script | when @apples is at least 3 | “when” and any check an “if” can make: once each time it comes true, like “when the {Hero} has at least 10 coins”. |
when the countdown ends | When a countdown gets to 0. | |
when the game starts | Once, as the game starts (and again after Try again or From start). | |
when any {Heroes} enters | When the hero comes into this level, or into the place you name: a level, a world or a building, like the {Bakery}. | |
when any {Heroes} leaves | When the hero goes out of this level, or out of the place you name. | |
when the {Slime King} is beaten | When the enemy with this ID is beaten, or a boss's part: {Slime King}'s {left head}. A boss's own scripts call it {boss}, and a part my {left head}. In a game or level script, “when any {Ghosts} is beaten” is each enemy in that family. | |
when the {Slime King} gets hit | When the enemy with this ID, or a boss's part ({Slime King}'s {left head}, or my {left head} in the boss's own scripts), takes a hit but isn't beaten yet. | |
when all {Ghosts} are beaten | When the last enemy in this family in the hero's level is beaten. For one at a time, write “when any {Ghosts} is beaten”. | |
when any {Heroes} picks up the {Gold key} | When the hero picks up the thing with this ID, or an item by its name in quotes. | |
when any {Heroes} opens the {North door} | When the hero opens the door, lock or chest with this ID. | |
when I get hurt | Each time I'm hurt. | |
when any {Heroes} gets hurt | Each time a hero is hurt. Inside the rule, the {Hero} is that hero. | |
when I am beaten | When I run out of health. | |
when I come back | When I come back to play after being beaten (online, with Respawn). | |
when any {Heroes} comes back | When a beaten hero comes back to play (online, with Respawn). Inside the rule, the {Hero} is that hero. | |
when I collect a coin | Each time I pick up coins. | |
when any {Heroes} collects a coin | Each time a hero picks up coins. Inside the rule, the {Hero} is that hero. | |
when any {Heroes} talks to the {Baker} | When the hero talks to the villager with this ID. | |
when I find a shard | Each time I find one of the goal's shards. | |
when any {Heroes} finds a shard | Each time a hero finds one of the goal's shards. Inside the rule, the {Hero} is that hero. | |
when I get a goal key | Each time I find one of the goal's keys. | |
when any {Heroes} gets a goal key | Each time a hero finds one of the goal's keys. Inside the rule, the {Hero} is that hero. | |
when I gain a skill | When I gain a skill, like Dash. Inside the rule, trigger skill is which one: dash, smash or swim. | |
when any {Heroes} gains a skill | When a hero gains a skill, like Dash. Inside the rule, the {Hero} is that hero, and trigger skill is which one: dash, smash or swim. | |
when any {Heroes} reaches a checkpoint | When the hero reaches a checkpoint flag, or the one with this ID. | |
when any {Heroes} reaches the goal | When the hero reaches the goal flag, just as the level ends. | |
when I hatch a power-up | When I hatch a power-up egg. Inside the rule, trigger power-up is which one, like speed boost. | |
when any {Heroes} hatches a power-up | When a hero hatches a power-up egg. Inside the rule, the {Hero} is that hero, and trigger power-up is which one, like speed boost. | |
when I get an extra life | When I earn an extra life. | |
when any {Heroes} gets an extra life | When a hero earns an extra life. Inside the rule, the {Hero} is that hero. | |
when any {Heroes} bounces on a spring | When the hero bounces on a spring, or on the one with this ID. | |
when my shield breaks | When one of my shields breaks. | |
when any {Heroes} loses a shield | When one of a hero's shields breaks. Inside the rule, the {Hero} is that hero. | |
when I jump | Each time I jump. | |
when any {Heroes} jumps | Each time a hero jumps. Inside the rule, the {Hero} is that hero. | |
when I attack | Each time I attack. | |
when any {Heroes} attacks | Each time a hero attacks. Inside the rule, the {Hero} is that hero. | |
when I crouch | Each time I crouch down. | |
when any {Heroes} crouches | Each time a hero crouches down. Inside the rule, the {Hero} is that hero. | |
when I stand still for 5 seconds | When I've stood still this long. Moving again lets it happen again. | |
when I join | When I come into the game, alone or online: the hero script's start. | |
when any {Heroes} joins | Online, each time a hero joins the game, and for everyone at the start. Inside the rule, the {Hero} is the one who joined. | |
when any {Heroes} quits | Online, each time a hero leaves the game. Inside the rule, the {Hero} is the one who left. | |
when any {Heroes} opens a mystery box | When the hero breaks open a mystery box. |
Behaviors
| Who | Word | What it does |
|---|---|---|
patrol | Walk about near my start: as far as my Walk distance in Object settings, or as many blocks as you say. | |
wander | Stroll about near my start, turning when something's in the way: a little way, or as many blocks as you say. | |
stand guard | Stay put and turn to face a hero I see. | |
stand still | Stay on my block. | |
chase the {Hero} | Run after the hero and bite. | |
fight smart | Circle the hero, dart in to bite, and back off again. | |
follow the {Hero} | Stay a little way behind the hero, without hurting them. | |
run away | Keep away from the {Hero} while I can see them. | |
watch the {Hero} | Stand still and keep turning to face the {Hero}. | |
charge at the {Hero} | Swimmers: rush fast at the hero I can see. Walkers chase them. |
Actions
| Who | Word | What it does |
|---|---|---|
lock me | Lock again, so the hero needs my key once more. | |
unlock me | Open, as if the hero had used my key. | |
my leads to is {Door 3} | Send the hero to another door, or to a level, by its name. | |
my key is {Key 2} | The key that opens me now, by its name. | |
stop | Stop what I always do until I hear “go”: a spring lies flat and doesn't bounce the hero; a platform, press, saw, belt or flyer stays still. | |
go | Start doing what I always do again, after “stop”. | |
turn around | Go back the way I came. A belt carries the other way. | |
fly by | Swoop across the screen now, along my fly-by path. | |
follow the {Hero} | Fly after the hero and hover over them, until I hear “fly home”. | |
fly home | Stop following and fly back to where I was placed. | |
press | Start a press from the beginning now. After “stop”, I do just this one and wait. | |
cut | Drop down and come back up now. After “stop”, I do just this one and wait at the top. | |
sink | Start sinking under the water now, as if the hero stood on me. | |
rise | Float back up to the top of the water. | |
my sinks when stood on is on | On: I start to sink when the hero stands on me. Off: I just float. “settings sinks when stood on” is where it started. | |
turn around | Face the other way, and walk that way if I'm walking. | |
attack | Use my weapon on the hero whenever I can. With no weapon, I bite. | |
stop attacking | Stop using my weapon until I'm told to attack again. | |
use my weapon | Use my weapon once, right now, at the hero, even after “stop attacking”. The next line waits until the shot is away. With no weapon, or Charge or Spooky, nothing happens. | |
dodge | Slip out of the way. Use it under “when the {Hero} swings at me”. | |
run away 3 blocks | Run this far away from the {Hero}, then carry on. Add “over 2 seconds” or “slowly” to set how long it takes. | |
move toward the {Hero} 2 blocks | Walk this far toward the hero, then carry on. | |
move left 3 blocks | Walk this far left, right, up or down (in a Platformer, left or right), then carry on. Blocks move all four ways, and carry whoever stands on them. | |
my row is 2 | Jump straight to this row. Row 1 is the bottom of the map. If I can't stand there, I stay put. | |
my column is 4 | Jump straight to this column. Column 1 is the left edge of the map. Set my row on the next line, and I go to both at once. | |
walk uphill | On a tipped seesaw platform, walk up it until it's level, or this far, like “walk uphill 2 blocks”. Nothing when it's level. | |
walk downhill | On a tipped seesaw platform, walk down it until it's level, or this far, like “walk downhill 2 blocks”. Nothing when it's level. | |
go home | Walk back to where I started. | |
jump back | Hop a little way back from the {Hero}. | |
jump | Jump straight up (2 blocks, or as high as it says, like “jump up 4 blocks”), and land before the next line. | |
jump toward the {Hero} | Leap toward the hero, onto a ledge or over a gap, and land before the next line. “jump toward the {Hero}, up 3 blocks” says how high. | |
jump away | Leap away from the {Hero}, and land before the next line. “jump away, up 3 blocks” says how high. | |
hop left 1 block | A short, low hop left or right (1 block, or as far as it says), landing before the next line. | |
jump left 3 blocks, up 3 blocks | One jump left or right this far (2 blocks if it doesn't say), 2 blocks high or as high as its “up” part says, landing before the next line. The parts can come in either order. | |
I burrow over 0.5 seconds | Go underground, where nobody can touch or hurt me. Without a time it happens instantly. With a time, finish before the next line; add ‘and go’ to carry on while sinking. | |
I emerge over 0.5 seconds | Come out of the ground. Without a time it happens instantly. With a time, finish before the next line; add ‘and go’ to keep sensing while rising. Object settings choose how much is above ground. | |
| Every script | wait 1 second | Stand still this long. Short waits can be in words: “wait half a second”, “wait a quarter of a second”. “wait 1 to 3 seconds” picks a time between them. |
face the {Hero} | Turn to look at the {Hero}. | |
| Every script | trigger "alarm" | Set off every “when” with this name, in every script, and wait until they're all done. Give it values by name, like trigger “alarm” with @count is 5, and they read them as trigger @count. End with “and go” to carry on straight away. |
| Every script | stop triggering | Inside a “when” with a name: the scripts after this one don't hear the trigger. Put it before any step that takes time. |
trigger my family | Run my family's steps for this same “when”, right here. A “when” of mine takes the place of my family's “when” with the same words, so this is how I do theirs too. | |
| Every script | say "Hello!" | Show words in a bubble above me for a few seconds. While a scroll is open (“show a scroll”), write them on the scroll instead, and wait for the player to read them. The game and level scripts say things only on a scroll. |
| Every script | log "I am chasing the hero" | Write a line in the builder's log, to see what a script is doing while you try the game. Put a @variable in it to see its value, like log “Health is @health”. Turn on Script log in Game settings to see it; players never do. |
| Every script | log @count | Write what a @variable holds in the builder's log, like “@count is 3”. For a thing, it says what the thing is, its ID, its level and where it is now; for a list, each thing in it. |
show "The gate is open!" | Show words in a banner across the screen, for 4 seconds or as long as you say. Banners show one after another. | |
show a scroll | Open a scroll for a story moment. Until “hide the scroll”, “say” writes on it and questions are asked on it, and the heroes stay still. Add “with typing effect” to type the words out, or “with auto scroll” to move on by itself after a pause. | |
hide the scroll | Put away the scroll from “show a scroll”, and let the heroes move again. | |
restore my size | Put one of my settings back to how the builder set it, whatever scripts changed: my size, opacity, hue, angle, look, effect, pose, weapon, speed and the rest. Add “over 2 seconds” to change back slowly, where the setting can. | |
restore level music | Put a setting of the hero's level back to its Map settings: its music, darkness, weather, gravity, traction or autoscroll. Add “over 2 seconds” to change darkness, gravity or traction back slowly. | |
restore {Game} boss music | Put the game's boss music or win music back to its Game settings. | |
show addon "Game Logo" | On a scroll: show one of the game's sprite addons by its name, playing, in the middle of the scroll. Choose a pose with “with @pose is "Walk left"”. A weapon shows still. | |
show picture "Boar" | On a scroll: show a built-in sprite by the name the builder gives it, like “Boar” or “Cooper”, playing, in the middle of the scroll. Choose a pose with “with @pose is "Walk left"”. | |
show the {Hero} | On a scroll: show the hero the player plays, looking out at them, in the middle of the scroll. Choose a pose with “with @pose is "Walk left"”. | |
show my picture | On my scroll: show my own sprite, looking out, in the middle of the scroll. Choose a pose with “with @pose is "Walk left"”. | |
open the {North door} | Open the door, gate or lock with this ID (unlocking it first). It must be in the hero's level. | |
close the {North door} | Close the castle door with this ID again. | |
lock the {North door} | Lock the door, gate or chest with this ID again. Only things with a lock in Object settings can be locked. | |
unlock the {North door} | Take the lock off the door, gate or chest with this ID, as its key would. | |
hide the {Bridge} | Take the thing with this ID out of play: it can't be seen, touched or walked on until it's brought back. | |
bring back the {Bridge} | Put a hidden thing back where it was. | |
hide me | Take all my blocks out of play: they can't be seen, touched or stood on until they're brought back. | |
bring me back | Put my hidden blocks back. | |
send home the {Baker} | The villager or enemy with this ID walks back to where it started. | |
{Game} take a "Sack of apples" from {Hero} | Take one of this item out of the {Hero}'s bag, if they have it. | |
{Game} take 5 coins from the {Hero} | Take coins from the {Hero} (all they have, if they have fewer). | |
move the {Hero} to the {Old well} | The screen fades and the hero is put by the thing with this ID, in the hero's level: just below it, or on the block itself. | |
I freeze | Keep me still (for a story moment) until “I unfreeze”. | |
I unfreeze | Let me move again after “I freeze”. | |
my attack is off | Stop me attacking or jumping (in a peaceful village, a sneaky room), until “my attack is on” or “my jump is on”. | |
my attack is on | Let me attack or jump again. | |
I gain dash | Gain a skill, as finding it would: dash, smash or swim. | |
I lose dash | Lose a skill I gained: dash, smash or swim. | |
I get a speed boost | A power-up, as hatching its egg gives: speed boost, super jump, jetpack or invincible. | |
start a countdown of 60 seconds | Show a clock counting down on the screen. “when the countdown ends” says what happens then. | |
stop the countdown | Stop the countdown and take it off the screen, without its “when the countdown ends”. | |
my health is 50% | Set my health, in percent of full. | |
level darkness is 80% | How dark the hero's level is, 0 (lit) to 100, as its Darkness in Map settings; “off” is 0. Add “over 2 seconds” to fade. | |
my weather is raining | Change the hero's level's weather: its name as its settings show it, like snow, fog or wind and rain, or a word like raining, stormy or sunny. | |
play the sound "Coin" | Play a sound: one of your own (its name in Media), or a built-in one, like “Coin”, “Door open” or “Fanfare”. | |
level music is "Midnight Dash" | Change the hero's level's music: one of your own songs, or a built-in one by its name in the Music list. | |
{Game} boss music is "Shadow Sneak" | Change the game's Boss music for the rest of the run. | |
{Game} win music is "Zoomies" | Change the game's Win music for the rest of the run. | |
| Every script | {Game} is won | The game is won, there and then, whatever its goal: its ending plays. Add words to show: {Game} is won with "You saved the village!" |
| Every script | {Game} is lost | Game over, there and then. Try again keeps the @variables. |
level is won | The level is beaten, as if the hero reached the goal: on to the next level. | |
level is lost | The hero loses a life and goes back to the last checkpoint, as falling into a pit does. | |
my lives is 5 | Set how many lives I have. | |
level gravity is 60% | The hero's level's gravity, 50% to 200%, as Gravity in Map settings: lower jumps higher and falls slower. Add “over 2 seconds” to change it slowly. | |
level traction is 20% | How well the hero grips the ground, 5% (slippery as ice) to 200%, as Traction in Map settings. | |
level autoscroll is on | Start or stop the camera moving on by itself, as Autoscroll in Map settings. | |
level autoscroll speed is 3 blocks a second | How fast an autoscrolling camera moves, in blocks a second (half a block to 6). | |
my speed goes up | Move one of my settings up a step: speed (slow, normal, fast, extra fast), and for enemies shot speed, shot size, grip (slippery, normal, sticky) or weight (normal, heavy). At the top step it stays there. | |
my speed goes down | Move one of my settings down a step, the other way from “my … goes up”. At the bottom step it stays there. | |
give my gift to the {Hero} | Hand the hero what “Gives the hero” is set to in Object settings. | |
flash for 1 second | Blink on and off this long (half a second if it doesn't say), then carry on. | |
{Game} give a "Sack of apples" to {Hero} | The game makes an item and puts it in the {Hero}'s bag: its name in quotes, as the bag shows it. Only the game can make things: a villager gives from their own bag with “give”. | |
give a "Sack of apples" to {Hero} | Give the {Hero} an item from my own bag, if it's in there. To make a new one from nothing, the game does it: {Game} give. | |
{Game} give 5 coins to the {Hero} | The game gives the hero coins, made from nothing. | |
offer "Health egg" to {Hero} for 3 "Sack of apples" | Offer the hero a deal: what they get, then “for” and what they give. Each side is an item in quotes, with how many in front, or coins. The hero sees both sides and picks Deal or No thanks. A villager gives from their bag, and what the hero gives goes into it. The script waits for the answer. | |
close my shop | My talk box has no Shop button until “open my shop”. Put it first in “when the {Hero} talks to me” to talk or make deals instead. | |
open my shop | My talk box has its Shop button again. | |
accept the offer | Take what the hero offered, and give them the item “Gives the hero” is set to, if I still have it. | |
accept the offer for "Health egg" | Take what the hero offered, and give them this item from my bag. | |
turn down the offer | Say no to what the hero offered: they keep everything. | |
put "Health egg" in the {Baker}'s bag | Put an item in the bag of the villager with this ID, if it has room. A shop keeper's bag is his shelves: add “for 10 coins” to set its price. | |
take "Health egg" from the {Baker}'s bag | Take one of this item out of the bag of the villager with this ID, if they have it. | |
close the {Baker}'s shop | The talk box of the shop keeper with this ID has no Shop button, until “open the {Baker}'s shop”. | |
open the {Baker}'s shop | The talk box of the shop keeper with this ID has its Shop button again. |
Settings
| Who | Word | What it does |
|---|---|---|
my rest between presses is 2 seconds | How long I wait between presses (a saw: at the top and at the bottom). “settings rest between presses” is where it started. | |
lower 2 blocks over 1 second | Let my chain out, so I hang this many blocks lower. With no time said, I go 2 blocks a second. | |
raise 1 block | Pull my chain in, so I hang this many blocks higher, up to where I hang from. With no time said, I go 2 blocks a second. | |
I start rocking | Swing back and forth from where I hang, 15 degrees each way unless you say how far. A longer chain swings more slowly. | |
I stop rocking | Stop swinging: I settle down to hang straight. | |
my launch speed is 20 blocks a second | How fast I launch the hero, from 12 to 25 blocks a second. “settings launch speed” is where it started. | |
my name is "Goblin" | The name the triggers I send give as trigger name. Until I set one, it's my brush's name, like “Bubble, green”. A name is words, not an ID: other scripts still point at me with my ID. | |
{Game} starting lives is 6 | How many lives the hero starts the game with. It goes at the top of the game script, before any “when” line. | |
my opacity is 50 | How solid I look: 100 is solid, 0 is invisible (I can still be touched). Add “slowly” or “over 2 seconds” to fade. | |
I am solid | The hero can stand on me and rides along when I move. A block that was pass through blocks everyone again. | |
I am not solid | Everyone goes through me as if I'm not there, though I can still be seen and still do what I do. | |
my pass through is on | On: everyone goes through me as if I'm not there, though I can still be seen. Off: I'm solid again. | |
my hue is 25 | Turn my colors round the rainbow, from -180 to 180; 0 is my own colors. Add “slowly” or “over 2 seconds” to shift. | |
my angle is 45 | Tilt me clockwise, from -180 to 180; 0 is upright, and -90 tips me the other way. Only my picture turns. Add “slowly” or “over 2 seconds” to turn. | |
I am spinning | Spin round where I am, clockwise, 1 turn a second, until “I am not spinning”. Only my picture turns, so I can spin anywhere, even in the air. “left” spins the other way. Say how fast with “2 turns a second”, “slowly” or “quickly”. | |
I am not spinning | Stop spinning, and stay at the angle I'm at. “I stop spinning slowly” or “over 1 second” slows me down until I'm upright. | |
my size is 150% | How big I am, from 10% to 400%, growing from my feet; “normal” is my own size, 100%. Add “slowly” or “over 2 seconds” to grow. | |
my size goes up by 20% | Grow by this much of my own size: from 100%, “goes up by 20%” makes 120%, up to 400%. Add “slowly” to grow gradually. | |
my size goes down by 25% | Shrink by this much of my own size: from 100%, “goes down by 25%” makes 75%, down to 10%. Add “slowly” to shrink gradually. | |
my look is dark | Look light or dark, or normal: as set in Colors. | |
my effect is frost | Put an effect round me: sparkles, fire, electric, frost, shadow, hearts, music, bubbles, dizzy, petals, or none. | |
my direction is left | Turn to face left, right, up or down. | |
my pose is windup | Show one of my art's poses, until another one. A pose you named in the Addon Lab goes in quotes: my pose is "Anger". “normal” goes back to walking and standing. | |
my weapon is lightning | Carry a weapon, as in Object settings: sword, ball-and-chain, crossbow, lightning, fireball, slimeball, ray gun, bomb, charge, run and leap, spooky, lobbed shot, beam, or none. A weapon of your own from the Addon Lab goes by its name in quotes: my weapon is "Ninja star". | |
my shot speed is slow | How fast my shots fly: slow, normal or fast. For a weapon that shoots or throws. | |
my shot size is big | How big my shots are: small, normal or big. For a weapon that shoots or throws. | |
my shot spin is on | My shots turn round and round as they fly. | |
my shot spin is off | My shots fly without turning. | |
my attack time is 2 seconds | How often I use my weapon, as Attacks every in Object settings. “1 to 3 seconds” picks a time between them. | |
my defeat effect is splat | How I go when I'm beaten, as Defeat effect in Object settings: normal, poof, fireballs, pop, splat, leaves, zap. | |
my speed is fast | How fast I move, as an enemy's Speed in Object settings: slow, normal, fast or extra fast. “my speed goes up” and “my speed goes down” move it a step. | |
my speed is 4 blocks a second | How fast my blocks move when a “move” doesn't say how long to take. 2 blocks a second to start with. | |
my grip is slippery | How well I keep my footing on a tipped seesaw platform, as Grip in Object settings: sticky (I never slide), normal or slippery (I slide twice as fast). | |
my weight is heavy | How hard I land, as Weight in Object settings: normal, or heavy to tip a seesaw platform where I stand and land. | |
my walk left is 4 blocks | How far left of my start I walk, as Walk left in Object settings. | |
my walk right is 4 blocks | How far right of my start I walk, as Walk right in Object settings. | |
my notice left is 8 blocks | How near on my left the hero must come before I notice them, as Notice left in Object settings. | |
my notice right is 8 blocks | How near on my right the hero must come before I notice them, as Notice right in Object settings. | |
my walk distance is 4 blocks | How far from my start I walk, each way, as Walk distance in Object settings. | |
my notice distance is 8 blocks | How near the {Hero} must come before I notice them, as Notice distance in Object settings. | |
my walk down stairs is on | Go down with the floor when it drops, as Walk down stairs in Object settings. | |
my walk down stairs is off | Turn around where the floor drops: Walk down stairs off. | |
I am harmless | I can't hurt the hero: touching me does nothing, and I stop using my weapon. Shots already in the air still hurt. The hero can still beat me. | |
I am harmful | I can hurt the hero again, by touch and with my weapon: “I am harmless” off. | |
I am invulnerable | The hero's attacks and stomps cannot hurt me. This does not change whether touching me hurts the hero. | |
I am vulnerable | The hero's attacks and stomps can hurt me again. This does not change whether touching me hurts the hero. | |
my body motion is bobbing | Bob, peck or splutter as I go, as Body motion in Object settings. How far and how fast stay as set there. | |
my swivel angle is 180 degrees over 1 second | Turn my physical swivel to this angle. A timed turn starts now and continues while the script runs its next step. | |
my length is 2 blocks over 1 second | Set how many blocks long my physical string is. A timed change reels it while the script continues. | |
my thickness is 0.06 blocks | Set the drawn width of my string in blocks. This does not change its collision shape. | |
my color is "#292827" | Set a physical string's color with six hexadecimal digits, such as "#292827". | |
my @range is 5 | Give me a @variable of my own, at the top of my script. Each copy of me has its own, set each time I start. In my script, @range means mine; write “shared @range” for the game's. Other scripts can use it too, as {my ID} @range. | |
secret my @mood is "grumpy" | Give me a @variable of my own that only my script can use. Other scripts can't read or change it. | |
@coins_needed starts at 10 | What a shared @variable holds when a new game starts. It goes at the top of the game script, before any “when” line. |
Variables
| Who | Word | What it does |
|---|---|---|
| Every script | @count is 0 | Remember a number, words in quotes, yes or no in a @variable. Every character in the game shares it, until a new game starts. “@count is nothing” clears it. Put it in “say” to show it, like say “You have @count”. For a list, put commas between the values: @months is “Jan”, “Feb” and “Mar”. “@picked is a list of words” starts an empty one. |
| Every script | add "May" to @months | Put a value on the end of a list. A @variable holding nothing becomes a list. A list holds up to 200 values. |
| Every script | remove "Jan" from @months | Take a value out of a list: the first one that matches. If it isn't there, nothing changes. |
| Every script | set item 2 of @months to "Feb" | Change the value at a place in a list: item 1 is the first. Past the end of the list, nothing changes. |
| Every script | @seen is whether I see the {Hero} | Remember the answer to any check an “if” can make: yes or no. Then “if @seen” asks it again later. |
| Every script | @roll is a random number from 1 to 100 | Pick a whole number at random, from the first number to the last, both included, and remember it in a @variable. Either end can be a @variable. Every player in an online game gets the same number. |
@left is the remaining {Heroes} | Remember how many of a family are still standing in the hero's level, like {Ghosts}. For {Heroes}, how many heroes are still in play, wherever they are. | |
@team is the number of {Heroes} | Remember how many heroes are in the game, beaten or not. Only for {Heroes}: for a family, write “the remaining {Ghosts}”. | |
| Every script | @count goes up by 1 | Add to the number in a @variable. The same as “@count is @count + 1”. |
| Every script | @count goes down by 1 | Take away from the number in a @variable. The same as “@count is @count - 1”. |
| Every script | give back @a + @b | Inside a function: end it here, and hand a value back to the line that used it, like “@total is sum with 2, 3”. |
@answer is the answer to "Would you like some apples?" with yes or no | Ask the hero a question, and remember the answer they pick. List 2 to 6 answers, with “or” or commas: yes, no, or words in quotes. Or give one list on its own, like “with @fruits”, and its values are the answers. The script waits for the answer. A villager asks only in “when the {Hero} talks to me”. | |
@name is the typed answer to "What's your name?" | Ask the hero a question they answer by typing, and remember what they type. Up to 20 letters, or say how many: “with @letters is 30” (at most 40). “@default is "Hero"” starts the box with an answer, which is also the answer if they close it. In order: “with 30, "Hero"”. The script waits for the answer. A villager asks only in “when the {Hero} talks to me”. | |
@deal is offer "Health egg" to {Hero} for 3 "Sack of apples" | Offer the hero a deal, and remember yes if they took it, or no if they said no or couldn't. | |
@apples is the number of "Sack of apples" in the {Hero}'s bag | Remember how many of something there is: an item in the {Hero}'s bag or in my bag (a shop keeper's shelves), or the {Hero}'s coins, shards or goal keys. |
Choices
| Who | Word | What it does |
|---|---|---|
| Every script | if … else … end | Do the steps under “if” when its check is true, or else the ones under “else”. Close it with “end”. |
| Every script | else if a 1 in 2 chance | Another check, tried when the ones above it weren't true. |
| Every script | else | What to do when no check above it was true. |
if my health is under 50 | Check my health, in percent: “under”, “over”, “at least”, “at most”, or “is” for exactly. | |
if my opacity is at least 50 | Check how solid I look, from 0 to 100. | |
if my hue is over 0 | Check how far round the rainbow my colors are turned, from -180 to 180. | |
if my angle is over 45 | Check how far I'm tilted, clockwise, from -180 to 180; 0 is upright. While I spin, it's the angle I'm at now. | |
if I am spinning | Whether I'm spinning, or slowing down to stop. | |
if my size is over 150 | Check how big I am, in percent of my own size: 100 is my own size. | |
if my look is dark | Check whether I look light, dark, or normal (as set in Colors). | |
if my effect is fire | Check the effect round me, or “none”. | |
if my direction is left | Check which way I'm facing: left, right, up or down. | |
if my weapon is lightning | Check the weapon I carry, as Object settings or “my weapon is” set it, or “none”. | |
if my speed is fast | Check my speed setting: slow, normal, fast or extra fast. | |
if the {Hero} is near | Whether the hero is within 3 blocks of me. | |
if the {Hero} is far | Whether the hero is more than 3 blocks from me: the other way round from “near”. “far away” works too, and so does “far from the {Door}”. | |
if the {Hero} is within 5 blocks | Whether the {Hero} is within this many blocks of me. | |
if the {Door} is within 5 blocks of me | Whether the thing with this ID is within this many blocks of me, or “near” for 3, and “far” for further. Measure between any two: “the {Goblin} is near the {Door}”, “I am far from the {Door}”, “the {Hero} is near the {Door}”. | |
if my row is over 1 | Check where I am: my row (row 1 is the bottom of the map) or my column (column 1 is the left edge). | |
| Every script | if the {Hero}'s column is over 10 | Check where the hero is, or a thing by its ID, like the {Guard}'s row. One that isn't here has no row or column. |
if my distance to the {Door} is under 5 | How far apart two things are, in blocks, in a straight line: my distance to the {Door}, the {Goblin}'s distance to the {Hero}. “is within 5 blocks” means at most 5. | |
if I see the {Hero} | Whether the hero is in my view (my Notice distance in Object settings). | |
if I am underground | Check whether I am underground, above ground, emerging, or burrowing. Above ground means I have finished rising to the height in Object settings. | |
if I am tilting | Whether the seesaw platform I stand on has tipped. | |
if my health is under 30% | Check my health, in percent of full. | |
if my lives is under 2 | Check how many lives I have. | |
if the {Hero} has at least 10 coins | Whether the hero carries at least this much: coins, shards, goal keys, an item by its name in quotes, or a key by its {ID}. A villager checks the hero talking to them. | |
if the {Hero} is near the {Old well} | Whether the hero is within 3 blocks of the thing with this ID, or “within 5 blocks of {…}”. “the {Hero} is far from the {Old well}” is the other way round. Any two things work too: “the {Goblin} is near the {Old well}”, and “the {Hero}'s distance to the {Old well}” is how far, in blocks. | |
if the {North door} is locked | Whether the door, gate or chest with this ID is locked, unlocked, open or closed. | |
if the remaining {Ghosts} is under 3 | How many enemies of this family are still standing in the hero's level. Give a family its name in the Families tab. | |
| Every script | if the {Hero} health is under 30% | Check the {Hero}'s health, in percent of full: in a game or level script, the hero who set off this rule. In a Platformer, “the {Hero} lives is under 2” too. |
if the remaining {Heroes} is under 2 | How many heroes are still in play, wherever they are. “the number of {Heroes}” counts every hero in the game, beaten or not. | |
| Every script | if trigger is from a boss | In a “when” with a name: who sent the trigger. From me, the hero, a friend, an enemy, a boss, a shop keeper, the game or a level; or “trigger is making deals” for a villager whose item is a deal. |
if the game is online | Whether friends are playing together online. | |
| Every script | if @answer is yes | Check what a @variable holds: yes, no, words (capitals don't matter), or a number with “under”, “over”, “at least” or “at most”. One never set is nothing, or 0 next to a number. |
| Every script | if @door_open | A @variable alone asks whether it holds yes. “if not @door_open” is when it holds anything else. |
| Every script | if @key is nothing | Whether a @variable was never set, or was cleared with “@key is nothing”. 0 isn't nothing. |
| Every script | if a 1 in 3 chance | Sometimes: 1 time in 3, or write a percent, like “a 30% chance”. |
| Every script | if @count is at least 3 and a 1 in 2 chance | Join checks with “and” (all must be true) or “or” (any one will do). Put “not” in front of a check for the opposite, like “if not the {Chest} is open”. |
Loops
| Who | Word | What it does |
|---|---|---|
| Every script | repeat 3 times … end | Do the steps between “repeat” and “end” this many times. “repeat forever”, or “repeat” on its own, keeps going until “stop repeating”. |
| Every script | repeat until … end | Do the steps between “repeat” and “end” again and again, until the check is true. It checks before every round, so if it's true already, the steps are skipped. |
| Every script | repeat for … end | Count with a @variable: it's 1 the first time round, then 2, up to 5. “from 10 to 1” counts down, and “by 2” goes up in twos. The @variable is the repeat's own, and is gone after “end”. |
| Every script | repeat for … in … end | Do the steps once for each value in a list, or each one in a family: @month is the one it's on now. “repeat for @number, @month in @months” also counts where it is in the list, from 1. Both @variables are the repeat's own, and are gone after “end”. |
| Every script | repeat all {…} … end | Do the steps once for each one in a family, like {Enemies}, {Heroes} or one of your own. Inside, {this one} is the one it's on now. It goes top row first, left to right, through the ones here as it starts. |
| Every script | end | Closes a “repeat” or an “if”. A “when” can end with one too, but doesn't need it, and neither does an “if” at the end of its “when”. |
| Every script | stop repeating | Leave the “repeat” early, like when a check inside it comes true. |
Built-in functions
| Who | Word | What it does |
|---|---|---|
| Every script | @day is the day of the week | Today's day of the week, as a number: 1 is Monday and 7 is Sunday. |
| Every script | @today is the date | Today's date, in words, like “16 November 2026”. |
| Every script | @day is the day | Today's day of the month, from 1 to 31. |
| Every script | @month is the month | This month, as a number: 1 is January and 12 is December. |
| Every script | @year is the year | This year, like 2026. |
| Every script | @hour is the hour | The hour of the day, from 0 (midnight) to 23 (11 at night). |
| Every script | @word is a random one of "foo", "bar" and "baz" | Pick one of the values at random, one of a list, like @jokes, or one of a family, like {Ghosts}. Every player in an online game gets the same one. |
| Every script | @month is item 2 of @months | The value at a place in a list: item 1 is the first. Past the end of the list, it's nothing. |
| Every script | @x is replace "hello" with "goodbye" in "Hello everyone" | Swap every “hello” in the last words for “goodbye”. Capitals don't matter when it looks. |
| Every script | @length is the number of letters in "Hello" | How many letters some words have, spaces too. |
| Every script | @size is the number of @months | How many values a list has. Nothing has 0. |
| Every script | @best is the bigger of @score, @best | The biggest of two or more numbers. |
| Every script | @least is the smaller of @a, @b | The smallest of two or more numbers. |
| Every script | @left is the remainder of @count / 3 | What's left over when one number is divided by another: the remainder of 7 / 3 is 1. |
Filters
| Who | Word | What it does |
|---|---|---|
| Every script | @x is "hello" then upper case | Every letter a capital: “HELLO”. |
| Every script | @x is "HELLO" then lower case | Every letter small: “hello”. |
| Every script | @x is "hELLO world" then capitalize | A capital at the start of each word, and the rest small: “Hello World”. |
| Every script | @x is "hello" then reverse | The letters back to front: “olleh”. |
| Every script | @x is 7 / 2 then rounded | The nearest whole number: 3.5 is 4, and 3.4 is 3. |
| Every script | @x is 7 / 2 then rounded up | The whole number at or above it: 3.1 is 4. |
| Every script | @x is 7 / 2 then rounded down | The whole number at or below it: 3.9 is 3. |

