Ambush on a timer

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
wishihadaname
Captain
Captain
Posts: 493
Joined: Fri Dec 28, 2007 2:10 pm
Projects :: The Corellian Resistance
Games I'm Playing :: Halo Reach and LOTRO
Location: Look to your left.... no, your other left....

Ambush on a timer

Post by wishihadaname »

I am currently trying to tie an ambush to a timer, it seems straight forward but i'm missing something because the ambush isn't spawning. I don't think I set up the timer wrong, there are no errors that say that much, but I must be using the wrong function to callup the ambush, or do I need to referance it somerwere else too? Anyways here is my code, could someone help me out?
Hidden/Spoiler:
--Timed Ambushes
round1= CreateTimer("round1")
SetTimer(round1, 100)
StartTimer(round1)
OnTimerElapse(
function(timer)
Ambush("Ambushregion6", "Droidpath4", 35, 6)
DestroyTimer(timer)
end,
round1
)
--Timed Ambushes
round2= CreateTimer("round2")
SetTimer(round2, 200)
StartTimer(round2)
OnTimerElapse(
function(timer)
Ambush("Ambushregion6", "Droidpath4", 35, 6)
DestroyTimer(timer)
end,
round2
)
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Ambush on a timer

Post by Fiodis »

Maybe you could try this?
Hidden/Spoiler:
--Timed Ambushes
round1= CreateTimer("round1")
SetTimer(round1, 100)
StartTimer(round1)
OnTimerElapse(
function(round1)
Ambush("Ambushregion6", "Droidpath4", 35, 6)
DestroyTimer(round1)
end,
round1
)
--Timed Ambushes
round2= CreateTimer("round2")
SetTimer(round2, 200)
StartTimer(round2)
OnTimerElapse(
function(round2)
Ambush("Ambushregion6", "Droidpath4", 35, 6)
DestroyTimer(round2)
end,
round2
)
Post Reply