I'm fairly new to LUA scripting, so please excuse the potentially silly questions that will no doubt follow
I'm trying to make a spawner shoot poison_bolts continually until a lever is in the activated state. So I created a lever and a 'for' loop script that in theory checks for the state of a lever and if it's deactivated, then do something. When I try and do this code...
Code: Select all
function poison()
for i in lever_lv2PoisonLever:getLeverState() do
if i.LeverState == "deactivated" then
spawner_lv2PoisonSpitter:activate()
else
spawner_lv2PoisonSpitter:destroy()
end
end
endCode: Select all
function workplease()
if lever_lv2PoisonLever:getLeverState() == "deactivated" then
counter_2.setValue(0)
end
endI might be using a completely arcane approach for which there's a very simple answer (I couldn't see a 'continual' flag on the spawner...). Any suggestions for how I can fix this would be most welcome!
Thank you.
