Timed actions?

Can someone make a simple lua script which executes stuff in the console each x minutes/hours?

For example:

After each 45 mins, x amount of server commands will be executed.

[lua]local commands = {
“sv_cheats” = 1,
“sv_alltalk” = 0,
}

function CallCommands()
for k,v in ipairs(commands) do
game.ConsoleCommand(k…" "…v)
end
end

timer.Create(“CallCommands”,60 * 45,0,CallCommands)[/lua]
Serverside script. Put stuff in commands table as shown.

Thanks :3:

[lua]local commands = {
[“sv_cheats”] = 1,
[“sv_alltalk”] = 0,
}

function CallCommands()
for k,v in ipairs(commands) do
game.ConsoleCommand(k…" "…v)
end
end

timer.Create(“CallCommands”,60 * 45,0,CallCommands)[/lua]

Fixed Endoros’ code:3:

lol, thanks :3:

[lua]local commands = {
[“sv_cheats”] = 1,
[“sv_alltalk”] = 0,
}

function CallCommands()
for k,v in pairs(commands) do
game.ConsoleCommand(k…" "…v)
end
end

timer.Create(“CallCommands”,60 * 45,0,CallCommands)[/lua]
Fixed again.

Ew, a global function.