-
Forum
-
- It is currently 12 Nov 2026, 12:24
- All times are UTC
The Lua scripting language allows you to give your plugin more advanced features.
-
FranchuFranchu
- Inhabitant of a Country
- Reactions:
- Posts: 796
- Joined: 27 May 2017, 22:07
- Location: Freezing in Argentina
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
Post
by FranchuFranchu » 19 Oct 2018, 00:42
Now Lua can be used in TheoTown. Lua is a real proggraming language. To learn it, read
this.
To include a Lua file in your plugin, use this:
The file has to be in the same directory as your JSON.
The Lua code can be this:
Code: Select all
function script.nextMonth()
Debug.toast("Hello Month!")
end
This will show a toast each month.
The full list of the available functions in TheoTown is in
https://theotown.com/forum/viewtopic.php?f=41&t=8587.
You do not have the required permissions to view the files attached to this post.
Did you know you can't blink while smiling :) ?
-
Mg3094066
- Inhabitant of a Supercluster
- Reactions:
- Posts: 3217
- Joined: 27 May 2017, 23:50
- Location: Venezuelan Republic of Mexico
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
Post
by Mg3094066 » 19 Oct 2018, 04:52
FranchuFranchu wrote: 19 Oct 2018, 00:42
Now Lua can be used in TheoTown. Lua is a real proggraming language. To learn it, read
this.
To include a Lua file in your plugin, use this:
The file has to be in the same directory as your JSON.
The Lua code can be this:
Code: Select all
function script.nextMonth()
Debug.toast("Hello Month!")
end
This will show a toast each month.
The full list of the available functions in TheoTown is in
https://theotown.com/forum/viewtopic.php?f=41&t=8587.
Ummm... What does the Lua test?
I threw my dignity to trash and downloaded Free Fire... But someway i liked it ":'D
But i think it was too early to celebrate... my internet runs at 8kb...
Just wait another month...
-
FranchuFranchu
- Inhabitant of a Country
- Reactions:
- Posts: 796
- Joined: 27 May 2017, 22:07
- Location: Freezing in Argentina
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
Post
by FranchuFranchu » 19 Oct 2018, 10:04
It shows a toast each month
Did you know you can't blink while smiling :) ?
-
ElephantEthan
- Inhabitant of a Megacity
- Reactions:
- Posts: 294
- Joined: 26 Aug 2018, 12:07
- Plugins: Showcase Store
-
Platform
Post
by ElephantEthan » 25 Oct 2018, 16:29
• Do lua scripts need a building to function? (like fun functionality)
• Can lua scripts be attached to anything? (buildings, terrain, trees, cars)
• How would one make a script that replaces a grass tile with a sand tile?
-
ElephantEthan
- Inhabitant of a Megacity
- Reactions:
- Posts: 294
- Joined: 26 Aug 2018, 12:07
- Plugins: Showcase Store
-
Platform
Post
by ElephantEthan » 25 Oct 2018, 18:24
CommanderABab wrote: 25 Oct 2018, 18:08
Yay! A triple negative sentencs!
Your post contains so much negativity that it's actually positive

although I'm not sure if I understand the land one.
-
ElephantEthan
- Inhabitant of a Megacity
- Reactions:
- Posts: 294
- Joined: 26 Aug 2018, 12:07
- Plugins: Showcase Store
-
Platform
Post
by ElephantEthan » 26 Oct 2018, 17:23
Alright, I attached a script to an animation and it works, even if I didn't use the animation. I got the script to run when you open the game. Really cool stuff!
-
TheRetroGuy
- Inhabitant of a Conurbation
- Reactions:
- Posts: 433
- Joined: 22 Jul 2018, 15:54
- Location: On the edge of a large table
- Plugins: Showcase Store
- Version: Beta
-
Platform
Post
by TheRetroGuy » 05 Nov 2018, 23:28
Is it possible to have a Lua app on mobile?
I am in fact, superior.
-
Bearbear76
- Inhabitant of a Multiverse
- Reactions:
- Posts: 5701
- Joined: 10 Feb 2017, 12:53
- Location: L2 cache
- Plugins: Showcase Store
-
Plugin Creator
Platform
Post
by Bearbear76 » 08 Nov 2018, 11:29
To be honest I don't like any of the apps that are available
In the store. Rather use a PC or just use a normal text editor that supports Lua (
i.e. QuickEdit)
Just my opinion
retired
-
Bearbear76
- Inhabitant of a Multiverse
- Reactions:
- Posts: 5701
- Joined: 10 Feb 2017, 12:53
- Location: L2 cache
- Plugins: Showcase Store
-
Plugin Creator
Platform
Post
by Bearbear76 » 23 Dec 2019, 00:08
rjroldan1 wrote: 22 Dec 2019, 12:04
Its like a java
Not really like Java.
Compared to java Lua is much more forgiving and easy.

Just my opinion
retired
-
JustAnyone
- Honorary Contributor
- Reactions:
- Posts: 3664
- Joined: 23 Jul 2017, 10:45
- Location: Easter Island
- Plugins: Showcase Store
-
Platform
Post
by JustAnyone » 23 Dec 2019, 15:08
Also 10x slower.