how to swap gold and exp?

Have this so far, but now somebody gets the exp/gold from the guy who killed an unit before:

xp = 0 gl = 0

function CAddonTemplateGameMode:OnModifyExperience( event ) gl = gl + event.experience event.experience = xp xp = 0 return true end

function CAddonTemplateGameMode:OnModifyGold( event ) xp = xp + event.gold event.gold = gl gl = 0 return true end

Comments

  • Posts: 2

    xp = 0
    gl = 0

    function CAddonTemplateGameMode:OnModifyExperience( event )
    gl = gl + event.experience
    event.experience = xp
    xp = 0
    return true
    end

    function CAddonTemplateGameMode:OnModifyGold( event )
    xp = xp + event.gold
    event.gold = gl
    gl = 0
    return true
    end