Hello, can someone fix this script?:
function onKill(cid, target, lastHit)
local reward = 2152
local exp = 500
if(isPlayer(cid) and isPlayer(target)) then
if(getIpByName(getCreatureName(cid)) ~= getIpByName(getCreatureName(target))) then
doPlayerAddItem(cid, reward, 1)
elseif(getPlayerName(cid) == getPlayerName(target)) then
doPlayerAddItem(cid, reward, 1)
else
doPlayerAddExperience(cid, - exp)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been punished for killing a player of the same IP.")
end
end
return true
end
Its working good, if i kill my MC i don't earn a platinum coin and i lose 500 exp. But if i kill myself by Fire field i earn platinum coin (Frag reward). I want to earn frag reward only when i kill other player, not myself by fire field. Bye ^_^.<event type="kill" name="fragreward" event="script" value="fragreward.lua"/>