This is the script:
I want to make this script works on Avesta 7.6, i've tryied many ways to make any player get experience killing others but all attemts failed.
Example:
If a lvl 200 kills a lvl 210 200 190 or 180 he gets experience but if he kills a lvl 179 170 160 or less than it he DOESN'T get experience.
HELP ME!
-- Quickly written by Znote.
function onKill(cid, target, lastHit)
local percent = 5 -- you get 5% experience from enemys total exp
if isPlayer(target) then -- If you killed a player and not a monster:
local xp = getPlayerExperience(target) -- fetch enemy experience
local calc = ((xp/100) * percent) -- calculate 1% of enemy experience, and multiply it with configured "percent"
local gain = math.floor(calc) -- Make sure the value is integer (etc 230 instead of 230,123123123)
doPlayerAddExperience(cid, gain) -- gives you the calculated experience
end
return true
end
I want to make this script works on Avesta 7.6, i've tryied many ways to make any player get experience killing others but all attemts failed.
Example:
If a lvl 200 kills a lvl 210 200 190 or 180 he gets experience but if he kills a lvl 179 170 160 or less than it he DOESN'T get experience.
HELP ME!