Running Lua Scripts

From The Powder Toy
Revision as of 20:57, 13 July 2016 by cxi (talk | contribs) (Update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is a tutorial showing how to run a Lua script in TPT.

Script Manager

Using the script manager is the easiest and most flexible solution and allows you to start and stop multiple scripts inside TPT. It also allows you to download moderator-approved scripts from a script server in a few clicks.

  • Go to this forum post and follow the instructions.

dofile

  • Download the script and move it to TPT's data folder. This can be found by entering the options menu in TPT and clicking "Open Data Folder".
  • Open the TPT console by pressing the ~ key inside of TPT.
  • Type in dofile("filename"), replacing filename with the full filename of the script, including its extension

If it says "could not find file", you entered the wrong filename.

Autorun

If you want a script be loaded every time you run TPT, you can set it as an autorun.

  • Download the script and move it to TPT's data folder. This can be found by entering the options menu in TPT and clicking "Open Data Folder".
  • Rename the script to "autorun.lua".