Give it a name
Try itThings that talk to each other
A script can only open a door if it knows which door you mean. So the door needs a name. In Splat Script, a name like that is called an ID.
An ID in a script
You have seen one ID already: {Hero}. The curly brackets mean "the thing with this name".
This code box holds a level's script. The level has a locked door in it, and the door's ID is Door.
Try it
- Press Play
, under the little game. Find the door: it is the block standing in the hero's way. - Click the little game, so the keys work.
- Press the up arrow key to make the hero jump.
The door opens. The script said open the {Door}, and the game knew which thing that was.
Give your own door an ID
Now make a door in level 2 of your game.
- Press Open your game here, in the builder below, and go to level 2.
- Press the Objects button
, on the left of the builder, and click Locks & keys. - In its Brush settings, under A key or a lock?, choose Lock block.
- Click on your floor to place it. This is your door.
- Press Select
, under the map, and click the lock block. - In its panel, open the drawer called ID and script.
- Type Door in the ID box.
Your door now has a name. Any script in the level can point at it with {Door}.
This section ticks itself when you press Play
in the code box.

