I'm bad at lua stuff, and I want a one and a half minute time to go on right when you start and then when it ends team 3 and team 2 spawn. Does anyone know how to do this?
Re: Spawn delay and timer
Posted: Mon Oct 17, 2011 3:56 pm
by AQT
Yeah. In the stock campaign luas, there is this function that checks if once the player spawns, then the objects will start. You will need that function. For more information, see the following:
Combine the timer with the information here, and you should be good to go. You essentially assign team 2's and 3's command posts to not use spawn paths. Then, when your timer hits zero, you assign the command posts their original spawn paths. Hope this help. I hope you weren't expecting someone to do the entire thing for you, by the way...
Re: Spawn delay and timer
Posted: Mon Oct 17, 2011 6:46 pm
by Noobasaurus
I tried my luck and (of course) it didn't work. Here it is:
Hidden/Spoiler:
[code]
onfirstspawn = OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) then
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
timer = CreateTimer("timer")
SetTimerValue(timer, (90))
StartTimer(timer)
SetProperty("Local_CP", "", "")
SetProperty("cp2", "", "")
OnTimerElapse(
function(timer)
SetProperty("Local_CP", "Local_Spawn", "")
SetProperty("cp2", "cp2_spawn", "")
end,
timer
)
end
end
)
[/code]
Absolutely nothing happened. I assume I put something wrong in the wrong place...
Or maybe I put the whole thing in wrong place! Probably not.
EDIT: I tried my luck again using a stock script and this is what I got and it doesn't work: