Hey there,
Seeking some help with a script I am trying to write
Basically the script is meant to..
if the victim did NOT attack first then -- no idea how to deal with this, currently doing it badly I am sure of it.
if the victim was a 'noob' then
remove a bunch of exp dictated by a rather large formula
Anyway, it doesn't work. I hope that someone will be able to help
Thanks,
Michael
Seeking some help with a script I am trying to write
Basically the script is meant to..
if the victim did NOT attack first then -- no idea how to deal with this, currently doing it badly I am sure of it.
if the victim was a 'noob' then
remove a bunch of exp dictated by a rather large formula
Anyway, it doesn't work. I hope that someone will be able to help
Thanks,
Michael
Code:
local expCalc = ((getPlayerLevel(cid) - getPlayerLevel(target)) / 100) -1) * getExperienceForLevel(getPlayerLevel(target))
function onKill(cid, target, lastHit)
if(isPlayer(cid) and isPlayer(target)) then
if getCreatureSkullType(target) ~= 1 or isPlayerPzLocked(target) == FALSE then
if (getPlayerLevel(cid)/getPlayerLevel(target)) <= 0.5 then
doPlayerAddExperience(cid, -(expCalc))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You just fragged a noob! You lose " .. expCalc .. "exp. Don't power abuse!")
end
return TRUE
end
end