Modify this and you can prevent player's getting xpexperienceByKillingPlayers ineed learn how i make the higer level palyer can't exp take in lower than payer
but the lower player can take exp higher player
function Player:onGainExperience(source, exp, rawExp)
if not source or source:isPlayer() then
return exp
end
-- Soul regeneration
local vocation = self:getVocation()
if self:getSoul() < vocation:getMaxSoul() and exp >= self:getLevel() then
soulCondition:setParameter(CONDITION_PARAM_SOULTICKS, vocation:getSoulGainTicks() * 1000)
self:addCondition(soulCondition)
end
-- Apply experience stage multiplier
exp = exp * Game.getExperienceStage(self:getLevel())
-- Stamina modifier
if configManager.getBoolean(configKeys.STAMINA_SYSTEM) then
useStamina(self)
local staminaMinutes = self:getStamina()
if staminaMinutes > 2400 and self:isPremium() then
exp = exp * 1.5
elseif staminaMinutes <= 840 then
exp = exp * 0.5
end
end
return exp
end
if source and source:isPlayer() and source:getLevel() < self:getLevel() then
if (self:getLevel() - source:getLevel()) >= 300 then
exp = 0
return exp
end
end
local noExpLevelHigherThan = 300 --Set to how high before no exp for player killing another player
function Player:onGainExperience(source, exp, rawExp)
if not source then
return exp
end
--PvP too high level
if source and source:isPlayer() and source:getLevel() < self:getLevel() then
if (self:getLevel() - source:getLevel()) > noExpLevelHigherThan then
exp = 0
return exp
end
end
-- Soul regeneration
local vocation = self:getVocation()
if self:getSoul() < vocation:getMaxSoul() and exp >= self:getLevel() then
soulCondition:setParameter(CONDITION_PARAM_SOULTICKS, vocation:getSoulGainTicks() * 1000)
self:addCondition(soulCondition)
end
-- Apply experience stage multiplier
exp = exp * Game.getExperienceStage(self:getLevel())
-- Stamina modifier
if configManager.getBoolean(configKeys.STAMINA_SYSTEM) then
useStamina(self)
local staminaMinutes = self:getStamina()
if staminaMinutes > 2400 and self:isPremium() then
exp = exp * 1.5
elseif staminaMinutes <= 840 then
exp = exp * 0.5
end
end
return exp
end