erksmit 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.
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?
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
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
COMBRO 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
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 closed