• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Exp Kill

xLosT

Member
Joined
Jan 11, 2010
Messages
1,022
Reaction score
13
Location
Brasil, Rio Grande do Sul
i have one script exp from killing high players, How can i modify to give exp to everyone even if kill level high or low player, and add the lost exp of the other player

EX: Player 1 kill player 2
player 2 loss "X" Exp, Player 1 gain "X" exp

Code:
function onKill(cid, target, lastHit)
   local attackPlayer = Player(target)
    if not attackPlayer then
        return true
    end

    for id, damage in pairs(attackPlayer:getDamageMap()) do
        local player = Player(id)
        if player then
            if attackPlayer:getLevel() >= player:getLevel() then
                local experience = attackPlayer:getExperience()
                local expFormula = ((experience / 100) * 0.75)
                player:addExperience(math.floor(expFormula), true)
            end
        end
    end
end
 
Back
Top