ConCommand not working

local function DepositBankAmt( ply, cmd, args )
local _T = args or {}
local _S = string.Implode( " ", _T )
if not args or args == “” then return end
if not tonumber( args ) then return end

ply:AddMoney( -tonumber( _S ) )
ply:SetNWInt( "colz_bank_balance", ply:GetNWInt( "colz_bank_balance" ) + tonumber( _S ) )

concommand.Add( “colz_deposit”, DepositBankAmt )
Works fine in console, no errors. The only problem is it doesn’t do what it’s suppose to: Remove the money, add the args to the players bank balance.


Nevermind, Fixed it myself.

Apparently it always returned false in my tonumber( args ) check.

That’s because args is a table containing the arguments.

Yep you should use args[1] for the first argument, args[2] for the second and so on.