Lua chatbox
-
erksmit
- Villager
- Reactions:
- Posts: 24
- Joined: 02 Mar 2018, 10:39
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Re: Lua chatbox
What happens with a lua script when i enter online mode? Im trying to make a script compatible with it, its got multiplayer: false in its manifest.
-
Hadestia
- Inhabitant of a Megalopolis
- Reactions:
- Posts: 722
- Joined: 17 Jul 2017, 14:16
- Location: Philippines
- Plugins: Showcase Store
-
Plugin Creator
Platform
Re: Lua chatbox
It will still work but locallyerksmit wrote: 16 Aug 2022, 10:07 What happens with a lua script when i enter online mode? Im trying to make a script compatible with it, its got multiplayer: false in its manifest.
-
JustAnyone
- Honorary Contributor
- Reactions:
- Posts: 3666
- Joined: 23 Jul 2017, 10:45
- Location: Easter Island
- Plugins: Showcase Store
-
Platform
Re: Lua chatbox
That is the intended change as of 1.10.73
-
erksmit
- Villager
- Reactions:
- Posts: 24
- Joined: 02 Mar 2018, 10:39
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Re: Lua chatbox
With the addition of the Car module i had the idea of dynamically spawning cars with diffrent tails depending on what they carry (what they carry is decided within). Now i wanted to also dynamically set the animation of the car to show a certain resource on its cargo bed, but i noticed there are no functions to set a car's animation. Would it still be possible to do this?
-
ian`
- Metropolitan
- Reactions:
- Posts: 117
- Joined: 04 Apr 2020, 15:36
- Location: 日本
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
Re: Lua chatbox
also the method to change the car despawn time when the car speed is zero. AFAIK, the default car despawn time is 10 days in normal speed.
Re: Lua chatbox
I don't understand what is wrong with this script. Nothing happens when the police car is at the coordinates of the road decoration.
function script.update()
-- Debug.toast("starting code!")
local car = Draft.getDraft('$carpolice00')
local carX = car.getX()
local carY = car.getY()
if Builder.isRoadDecoBuildable('$undead_horde_plugin_00', carX, carY) then
Builder.removeRoadDeco(carX, carY)
Debug.toast("destroy undead!")
end
end
function script.update()
-- Debug.toast("starting code!")
local car = Draft.getDraft('$carpolice00')
local carX = car.getX()
local carY = car.getY()
if Builder.isRoadDecoBuildable('$undead_horde_plugin_00', carX, carY) then
Builder.removeRoadDeco(carX, carY)
Debug.toast("destroy undead!")
end
end
Re: Lua chatbox
Write lua script For TutorialCERRERA wrote: 06 Dec 2021, 13:28 20211206_232418.jpgAnyone can help me?
If u press building or category you will go into link
Example I press the help category you will go to yt
Sorry Idk how lua works
Re: Lua chatbox
The clarification on using nil for optional parameters and the distinction between . and : in Lua syntax were especially useful.
Looking forward to more insights like this—thanks again!
Looking forward to more insights like this—thanks again!
Re: Lua chatbox
hello, may I ask? I want to know how the railway crossing plugin works, why can the crossing bars open and close automatically when a train approaches? Please answer 
-
yinx
- Small-town resident
- Reactions:
- Posts: 34
- Joined: 11 May 2026, 01:58
- Location: Ha Noi
- Plugins: Showcase Store
-
Plugin Creator
Platform
Re: Lua chatbox
It's simple: just use the countcarroad function. Essentially, railway tracks also have the 'road' attribute and trains have the 'car' attribute, so this function works. You just need to monitor the cell where the vehicle count increases—that means a train has arrived. At that point, simply switch the frame status from open to closedCOMBRO wrote: 04 Mar 2026, 09:38 hello, may I ask? I want to know how the railway crossing plugin works, why can the crossing bars open and close automatically when a train approaches? Please answer![]()