Docs / Scripting · v0.95.0

Scripting in Floptle (Lua)

Scripting in Floptle (Lua)

Game logic in Floptle is written in Lua. A script is a .lua file in your project's scripts/ folder. Attach it to a node and it runs every frame while the game is playing. Scripts hot-reload — save the file and the running game picks it up immediately.

This page teaches; lua-api.md lists. The guide is in chapters: read one end to end and you have that part of the engine, or dip into one when you need it. The reference has every call the engine answers, grouped and searchable, for when you already know the name and want the signature.

The same chapters are in the editor — Scripting tab → § Docs📖 Guides, with the contents down the left — and every call shows up as autocomplete and hover hints as you type. All three are generated from one table, so they cannot disagree.

Section numbers are stable and are what the engine's own messages cite ("see scripting.md §16"), so they stay put even when a chapter is rearranged around them.

Start here

Your first script, the hooks the engine calls, and the globals every script has.

Nodes & the scene

Moving things, finding things, and swapping the whole world out.

Physics

Bodies, collisions, and asking the world what is in front of you.

Input

Keyboard, mouse, and the action map.

Assets & materials

Models, textures, materials and data files, swapped while the game runs.

Animation, particles & sound

The three things that make a scene feel alive, driven from a script.

Maths & the world

Vectors, terrain, water, scattered props, and orbital time.

Multiplayer

Replication, remote calls, rollback, and voice.

Data, time & the outside world

Saved games, timers, HTTP, the player's account, and the settings a game offers.

Steam

Leaderboards, lobbies, and the overlay.

Working in the editor

The in-engine IDE, the profiler, the gotchas, and why some calls refuse.