• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Gold and Exp kill player

FKaupert

Joker Wolf
Joined
Nov 14, 2009
Messages
60
Reaction score
0
Location
Brazil
Hello people, I'm looking for a script where the player earns gold and exp when killing another player.

I would like him to win:
Exp: Level (other player) * 1
Gold: Level (other player) * 2

Can help me?
 
Lua:
function onKill(cid, target, lastHit)
if isPlayer(cid) then
   if isPlayer(target) then
      doPlayerAddExp(cid, getPlayerLevel(target))
      doPlayerAddItem(cid, 2148, getPlayerLevel(target)*2)
   end
end
return true
end

Register it in login and add the line in xml
 
@Santi, i registered and added, but did not work ... The script does not give any error, but neither worked.

Using 0.2?
It should work fine in 0.3.6, I think.
Put the xml line and how you registered it in login, probably you made a mistake
 
@Up: Event name should have the same name as the registered event:
Lua:
registerCreatureEvent(cid, "xpgold")
To:
Lua:
registerCreatureEvent(cid, "XPGOLD")
 
Back
Top