GriefBot

Lua scripts

Scripts · Added

Write Lua that draws on screen and in the world, reads players, grenades, fires and the bomb, runs timers and reacts to 34 game events. Saving reloads it.

How it works

The Scripts tab runs Lua 5.4 files from GriefBot's scripts folder: every .lua file there becomes a card with its own switch and cog. A script can draw text, lines, rectangles and circles on screen and shapes in the world, read players, grenades, fires and the bomb, run timers, and react to game events such as player_death. Saving the file reloads it while it is on. Each card shows when the file was last saved, what the script costs per frame and, if it stopped, the error and its line; print() output and errors also land in the Output panel. Every script runs in its own sandbox: it can draw and read the game, but cannot touch your files, start programs, reach the network or change what the game or the rest of GriefBot does. Limits include 64 MB of memory and 20,000 shapes a frame per script.

Settings

In the menu: Scripts card, Scripts tab

Open folder
Opens the scripts folder. Every .lua file in it is a card here.
Get scripts
Scripts other people published, in Config > Library.
Reference
Every function, event and limit, with examples, in the scripting reference.
Card switch
Starts the script, or stops it. Its settings are kept.
Edit
Opens the file in your editor. Saving it reloads the script.
Reload
Runs the file again from the top. Settings are kept.
Publish
Publishes this file to the public library. You name it first.
New script
Makes a short starter script under this name, switches it on and opens it.
Output
What scripts print, and the full error when one stops.

In 2 builds' release notes

  1. v6

    Scripts get vectors, timers, menu buttons, world-space lines and rings, player boxes and bones, grenades and fires, and 13 more game events.

  2. v5.11

    A new Scripts tab runs your own Lua: draw on screen, read players and the bomb, react to 21 game events, and give each script its own settings - every save reloads it in game.

More in Lua scripts 4

Your own overlays in a few lines of Lua, with their own settings in the menu.