There's a /lockdown command that prohibits anyone from entering or leaving, in case you were unaware.
Additionally, I don't know if you just edited it or not, but nothing in that script loops, like you say. The only two hooks that are continuously called are draw2d and draw3d.
Oh I forgot about this command. Also it should loop on new_game I don't know why it doesn't, because for me it's fine. And what are you talking about? Where in my code it says about draw2d or draw3d hooks?
The new_game hook is only called at the beginning of a new match.
I was talking about hooks in general, not in your code. The only hooks in Toribash that run continuously are draw2d and draw3d (and I guess enter_frame, if you press P).
Why would I want other hooks? I thought he wanted to do the betting before the match begins. I thought my code moves everyone to spec, lets them bet and then force enters them to the game? Is it missing a feature?
Sorry if I'm stupid ;)
I'm not telling you to add these hooks. You said that the script is "looping at max speed", but that should not be true unless you add the draw2d or draw3d hooks, which are the only hooks that are called continuously. Even then, it shouldn't really be a problem unless you're doing very complicated processing in that hook function.
I also noticed that your script force-spectates everyone in the server to commence betting. You can't bet if there are no players in the match.
local targetTime = 0
local function idontcare()
if (num == 0) then
num=1
run_cmd("specall")
run_cmd("enterfee 1000000")
run_cmd("cancelbets")
run_cmd("minbet 100")
run_cmd("cp bet bet bet!")
targetTime = tonumber(os.date("%I%M%S")) + 30 --time in seconds
add_hook("draw2d", "countdown", function()
if tonumber(os.date("%I%M%S")) >= targetTime then
remove_hook("draw2d", "countdown")
closeBetting()
end
end)
end
end
local function closeBetting()
run_cmd("minbet 1000000")
run_cmd("cp betting closed!")
people=get_bouts()
run_cmd("enterfee 0")
for i=0,#people do
run_cmd("fenter "..people[i])
end
end
Untested but should work.