Difference between revisions of "Running Lua Scripts"
(Created page with " ---- This is a guide to successfully run a Lua script published by community. There are several ways of doing that. ==== Dofile ==== * Download the script to your TPT folder...") |
(Update) |
||
(4 intermediate revisions by 4 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. | ||
− | This | + | == 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 <code>dofile("filename")</code>, replacing <code>filename</code> 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". | |
− | If you want | + | * Rename the script to "autorun.lua". |
− | * Download script to TPT | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | * | ||
− | |||
− | |||
− | |||
− |
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".