• 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!

Exp system (Player killing)

Joriku

Working in the mines, need something?
Joined
Jul 16, 2016
Messages
1,088
Solutions
15
Reaction score
382
Location
Sweden
YouTube
Joriku
Possible to make a system that works with world type = "pvp" that gives players exp from killing another/assisting on killing a player?
And "killstreak"
Explanation:
John kills Emma
John gets 0.5 Level(s).
John kills Emily and have help from Emma.
John gets 0.7 level (2 Streak) + 0.2 exp for a streak. Emma gets 0.5 level (1 Streak).

Source atm:
None
(Pvp-Enforced)
Lua:
function onKill(cid, target, lastHit)

  if(isPlayer(cid) and isPlayer(target)) then
    if getPlayerIp(cid) ~= getPlayerIp(target) then
      doPlayerAddExperience(cid, (getPlayerExperience(target))) -- you will likely want to introduce a formula here
      else
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You will not receive anything for killing players of the same IP.")
    end
  end

return true
end
 
Last edited:
Back
Top