Appearance
Recipes
Working scripts for the things people actually build. Every one is complete — copy it onto an object and it runs.
New to this? Start with Your first script.
Things you click and walk into
| Doors and switches | a door that opens, closes itself, or is driven by a switch across the room |
| Triggers and zones | greeters, pressure plates, checkpoints, hazards |
| Moving things | lifts, platforms, patrols, conveyors, projectiles |
Things players hold
| Pickups and carrying | pick it up, pose it, put it down, hand out copies |
| Weapons and combat | a complete weapon: recoil, cone, ammunition, reloading |
| Poses and animations | make a pose in the animator and play it on somebody |
| Damage and destruction | breakable props, player health, respawning |
Talking to players
| Menus and HUDs | panels, pages, live numbers, world prompts |
| Shops and currency | a counter, a balance, goods that reach a hand |
The world itself
| Effects and atmosphere | fire, smoke, lamps, weather, storms |
| Sound and music | one-off noises, loops, distance, ambience |
| Terrain and blocks | sculpting ground, mining, generated structures |
| Building and survival | pieces players raise, support, resources that regrow |
Plumbing
| Saving data | what survives a restart, and how to store it |
| Talking between scripts | events, public channels, tags |
Five habits worth copying
They show up in nearly every recipe here.
Check before you use. Anything that can answer nil deserves the check, and the shape is always the same:
luau
local part = self:part("hinge")
if not part then return endAsk the engine, do not remember. self:held_at(), player.holding, self:get(...) — a local copy of the world's state goes stale the moment something happens by a route your script does not run.
Act on the change, not on the tick. A timer that writes the same properties every second spends the region's budget for nothing.
luau
if should ~= current then
current = should
apply(current)
endSave a timestamp, not a countdown. world:clock() keeps running while the world is off, so a stored moment is still true after a weekend. A countdown only moves while somebody is ticking it.
Cancel the timer you are replacing. Otherwise clicking twice leaves two of them, and the second one fires into a world that has moved on.
See also
- API reference — every option of everything used here
- Reading errors — when a recipe does not behave
