Page 1 of 1
Noob Question About Loops
Posted: Mon Jul 07, 2014 2:31 am
by Krazzikk
I want to make the spawner activate on a loop, so it keeps spawning the fireball over and over. This is what I have so far, but even that, without the loop, won't work.
Code: Select all
function loopSpawner()
if PressurePlate:isDown() then
loopSpawnerOne:activate()
end
end
Re: Noob Question About Loops
Posted: Mon Jul 07, 2014 3:37 am
by Allanius2
Krazzikk wrote:I want to make the spawner activate on a loop, so it keeps spawning the fireball over and over. This is what I have so far, but even that, without the loop, won't work.
Code: Select all
function loopSpawner()
if PressurePlate:isDown() then
loopSpawnerOne:activate()
end
end
What you should do is add a two connectors to the pressure plate to a timer so the "Activate" of the plate activates the timer, and the "Deactivate" deactivates the timer. Then just set the delay time on the timer, and have it activate the spawner.
Re: Noob Question About Loops
Posted: Mon Jul 07, 2014 2:29 pm
by Krazzikk
Thanks ^_^
Re: Noob Question About Loops
Posted: Tue Jul 08, 2014 12:22 am
by Allanius2
You're welcome.
Re: Noob Question About Loops
Posted: Tue Jul 08, 2014 3:38 am
by Chimera005ao
Scripts put in a function won't do anything unless that script is triggered somewhere.
Pressure plates, buttons, and other scripts can trigger them.
You can make a repeating fireball launcher with just a timer and spawner.
Though scripts called by timers can do other cool things that spawners can't, like doors that toggle every couple seconds.