Hello, I made myself a script that gives you a % of the victim's Xp. I tried editing it to fit your needs. The formula in the script is one that I found on tibia.wikia for the death loss rate of Tibia.
go to your creaturescripts folder, then go into the script folder and open the file playerdeath.lua.
Scroll down to the part that says if byPlayer == 1 then and right below it add
local killerLvl = getPlayerLevel(killer)
local victimLvl = getPlayerLevel(cid)
local victimExpLoss = ((victimLvl+50)/100)*(50*(victimLvl^2-((5*victimLvl)+8)))
local killerGain = victimExpLoss
if killerLvl < victimLvl then
doPlayerAddExp(killer,killerGain)
end
Hope this helps, let me know if it does!
Vonuzur
- - - Updated - - -
I also just kind of realized that this script will only work for the person that gets the killing hit(I'm pretty sure).
If this is the case and you figure out how to make it work for multiple killers let me know, I also have a thread created for trying to solve this problem with my script as well.
Sorry I didn't think about that when I gave you the formula, was just trying to help.
Hopefully we can get our scripts working!