
[SOLVED] Spike Traps
- Ciccipicci
- Posts: 154
- Joined: Mon Oct 08, 2012 12:55 am
[SOLVED] Spike Traps
I need the script to make spike traps initially on and that alternate always one by one long a line.


Last edited by Ciccipicci on Sat Jan 24, 2015 5:55 pm, edited 1 time in total.
Re: Spike Traps
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"
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...
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
endthen place objets floor_spike_trap and name it "spikes_1", "spikes_2", "spikes_3" etc... up to number in sequence...
Last edited by Drakkan on Sat Jan 24, 2015 10:23 pm, edited 1 time in total.
- Ciccipicci
- Posts: 154
- Joined: Mon Oct 08, 2012 12:55 am
Re: Spike Traps
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!
To make it working I should name script "spikes_01" or similar and not only "spikes."
Thank you so much!