Saint Spear
Veteran OT User
- Joined
- Jun 22, 2016
- Messages
- 1,547
- Solutions
- 18
- Reaction score
- 378
Hello, can someone give script to me to works like this, When i kill player i want to get 5 platinum coins 
thanks

thanks
mmm, I think onKill only works for the person who last hit the target.yeah was about to post this, i sadly don't remember the old main function arguments, thought onDeath would work (wanted it to only give it to the actual killer, not all players that did damage with onKill)
uint32_t flags = 0;
if(entry.isLast())
flags |= 1;
if(entry.isJustify())
flags |= 2;
if(entry.isUnjustified())
flags |= 4;
function onKill(cid, target, damage, flags)
if bit.band(flags, 1) == 1 then...
yeah was about to post this, i sadly don't remember the old main function arguments, thought onDeath would work (wanted it to only give it to the actual killer, not all players that did damage with onKill)Problem is with the main function.
//onDeath(cid, corpse, deathList)
You need to use 'onKill' instead.
Code:function onKill(cid, target, damage, flags) if isPlayer(cid) and isPlayer(target) then doPlayerAddItem(target, 2152, 5) end return true end
mmm, I think onKill only works for the person who last hit the target.yeah was about to post this, i sadly don't remember the old main function arguments, thought onDeath would work (wanted it to only give it to the actual killer, not all players that did damage with onKill)
uint32_t flags = 0;
if(entry.isLast())
flags |= 1;
if(entry.isJustify())
flags |= 2;
if(entry.isUnjustified())
flags |= 4;
function onKill(cid, target, damage, flags)
if bit.band(flags, 1) == 1 then
if isPlayer(cid) and isPlayer(target) then
doPlayerAddItem(cid, 2152, 5)
end
end
return true
end
[Warning - Event::loadScript] Event onDeath not found (data/creaturescripts/scripts/reward.lua)Problem is with the main function.
//onDeath(cid, corpse, deathList)
You need to use 'onKill' instead.
Code:function onKill(cid, target, damage, flags) if isPlayer(cid) and isPlayer(target) then doPlayerAddItem(cid, 2152, 5) end return true end
change in creaturescripts.xml from "death" to "kill"[Warning - Event::loadScript] Event onDeath not found (data/creaturescripts/scripts/reward.lua)
onKill executes for all players who hit the targetmmm, I think onKill only works for the person who last hit the target.
I don't have any way to test that though.
Sorry, I was typing while thinking.onKill executes for all players who hit the target
yeah i saw but i was just letting you knowSorry, I was typing while thinking.
If you read further, I did come up with the correct solution I believe.