Pay amount system for certain teams?

So, I want it to be where if you are on team 1, you get 60$ every 5 sec and if you are on team 2, you get 75$ every 5 sec. I got this code, but it doesn’t work:

[lua]
local meta = _R[ “Player” ]
function meta:GetMoney()
return self:GetNWInt( “Money” )
end

   function meta:SetMoney(amount)
          return self:SetNetworkedInt( "Money", math.floor( amount or 0))
   end
   function meta:AddMoney(amount)
          return self:SetNWInt( "Money", self:GetNWInt("Money") + math.floor(amount or 0))
   end

if pl:Team() == 1 then
timer.Create( “AddMoney”, 5, 0, function()
for k, v in pairs( player.GetAll()) do
v:AddMoney( 60 )
end
end )
elseif pl:Team() == 2 then
timer.Create( “AddMoney”, 5, 0, function()
for k, v in pairs( player.GetAll()) do
v:AddMoney( 75 )
end
end )
end
[/lua]

Well, first of all I get the feeling you probably have no clue what you’re doing. It looks like you just threw two code snippets together in a Lua file and hoped it would work. For instance, you never define “pl” in any way. I have no clue what the point of that is. What you’re looking for is just this:

[lua]timer.Create( “AddMoney”, 5, 0, function() for _,v in pairs( player.GetAll() ) do
if v:Team() == 1 then v:AddMoney(60) elseif v:Team() == 2 then v:AddMoney(75) end
end)[/lua]

Thanks. And, you are correct. I did just throw it in, my friend gave me the code.