I've looked through a lot of threads, and I can't get this to work. Literally, nothing happens; no exp, no message, no platinum coin, dying is the same as it was before I added these.
Any help would be much appreciated =)
fragrewards.lua
creaturescripts.xml
login.lua
Any help would be much appreciated =)
fragrewards.lua
Code:
function onKill(cid, target, lastHit)
if cid ~= target and isPlayer(target) then
if getPlayerIp(cid) == getPlayerIp(target) then
doPlayerAddExperience(cid, -500)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have been punished for killing a player of the same IP.')
else
doPlayerAddItem(cid, 2152, 1)
doPlayerAddExperience(cid, 500)
doSendAnimatedText(getPlayerPosition(cid),"500", TEXTCOLOR_WHITE)
end
end
return true
end
Code:
<event type="kill" name="FragReward" value="fragreward.lua"/>
Code:
registerCreatureEvent(cid, "FragReward")