I'm working on a little script that'll change the job of a player after a given time, but for some reason I can't get the timer to work, what am I doing wrong? I've tried moving it all to one line and I've also tried rewriting the timer, but alas no result :/
local Players = player.GetAll()
for i = 1, table.Count(Players) do
local ply = Players[i]
if (ply:Team() == TEAM_DEFAULTED ) then
timer.Create("randomJob", 180, 1,
ply:changeTeam( job_table[randomJob], true),
ply:PrintMessage(HUD_PRINTCENTER, "Your job has been auto-selected")
end)
end