Page 1 of 1
[SOLVED] Spike Traps
Posted: Sat Jan 24, 2015 3:21 pm
by Ciccipicci
I need the script to make spike traps initially on and that alternate always one by one long a line.

Re: Spike Traps
Posted: Sat Jan 24, 2015 4:59 pm
by Drakkan
not sure if this is what you need, but
create timer called "spikes_timer", tick timer (interval 0,4 sec) and set on activate to function tick() inside script called
"spikes"
Code: Select all
step = 1
function tick()
local seq = { 1,2,3,4,5,6,7,6,5,4,3,2 }
findEntity("spikes_"..seq[step]).controller:activate()
step = step%#seq+1
end
you can change the sequence here as you want, it will be repeating again and again.
then place objets floor_spike_trap and name it "spikes_1", "spikes_2", "spikes_3" etc... up to number in sequence...
Re: Spike Traps
Posted: Sat Jan 24, 2015 5:44 pm
by Ciccipicci
Thanks Drakkan. It should be what I'm searching for. Anyway, following your solution triggering timer with script doesn't call any function.
To make it working I should name script "spikes_01" or similar and not only "spikes."
Thank you so much!