Money System - Having Problems

I created a script to give you money everytime you kill a zombie/mob. However, it gives me an error with a particular part of the script.

local function OnNPCKilled( victim, killer )  
    if ValidEntity( killer ) and killer:IsPlayer( ) then  
        killer:AddMONEY( REWARD_MONEY )

It gives me an artihmatic error but I can’t see the problem. Can someone help me?

(User was banned for this post ("Wrong forum" - mahalis))

Exact error, please.

It doesnt display the error anymore. But now i’m not sure if its saving

function Player:Save( )  
    EasyLog( "%q (%s) had their MONEY saved.", self:Nick( ), self:UniqueID( ) )  
    self:SetPData( "MONEY" , self.MONEY or DEFAULT_MONEY ) 

No error for saving, but usually after I get a kill my XP system auto saves. This is the same system just replacing XP with money.


Please help!


There is no error. I’ll send the whole script.

Is it Attempt to Perform arithmatic on REWARD_MONEY… something like that? Where have you defined reward money… is it even defined? does REWARD_MONEY have maths in the definition? These sort of things are needed.

Yes, REWARD_MONEY is defined at the beginning of the script… It does have math.

try + REWARD_MONEY and dont put math in REWARD_MONEY just use = sign in that