Difference between revisions of "Running Lua Scripts"
(Fixed some typos; Added reference to the Autorun Manager.) |
(Update) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | 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 [http://tpt.io/:19400 forum post] and follow the instructions. | ||
− | + | == dofile == | |
− | * Download the script to | + | * 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 <code>dofile("filename")</code>, replacing <code>filename</code> with the full filename of the script, including its extension | |
− | |||
− | * Type in | ||
− | If it says | + | If it says "could not find file", you entered the wrong filename. |
− | + | == Autorun == | |
− | If you want | + | If you want a script be loaded every time you run TPT, you can set it as an autorun. |
− | * Download script to TPT | + | * 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". | |
− | |||
− | |||
− | |||
− | |||
− | This | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | * | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 20:57, 13 July 2016
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")
, replacingfilename
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".