Run a timed function at the beginning of Fretta pre-round freezetime
0 replies, posted
This is what I'm trying to achieve here: I have two functions, GM:DetermineRoundRules() and GM:DetermineRandomWeapon(), both defined in sv_varules.lua. They're supposed to run 3 and 6 seconds after a new round starts. So I tried putting this in init.lua:
[lua]function DummyRules()
if GetGlobalInt( "RoundNumber", 0 )==1 then //On the first round, there are no "rules".
PrintMessage( HUD_PRINTCENTER, "Welcome to\nVARIANTASSAULT" )
for k, v in pairs(player.GetAll()) do
v:ConCommand("play variantassault/misc/rules_update.wav")
end
else
GM:DetermineRoundRules()
end
end
function DummyWepon()
GM:DetermineRandomWeapon()
end
function VARoundBegin()
timer.Simple( 3, DummyRules )
timer.Simple( 6, DummyWepon )
end
hook.Add("OnRoundStart", "VARoundBegin", VARoundBegin)[/lua]
Nothing happens.
Sorry, you need to Log In to post a reply to this thread.