Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- CONFIG
- local config = {}
- config.multiplier = 1 -- EXP Multiplier
- config.m_multiplier = 1 -- Money Multiplier
- config.exp_max = 72.7 -- How Much EXP Multiplier To Rank Up? (Example: Level 1 (1*72.2)=Exp Multiplier (72.7 EXP Required For Rank 1))
- config.prestige_level = 100 -- Level To Prestige At
- config.money_reward = 2 -- How Much Money Multiplier For Ranking Up? (Example: Level 1 (1*2)=Money Multiplier ($2 Reward For Rank 1))
- config.p_money_reward = 100 -- How Much Money Multiplier For Prestiging Up? (Example: Prestige 1 (1*2)=Money Multiplier ($2 Reward For Rank 1))
- -- DONT TOUCH BELOW
- local _p = FindMetaTable("Player")
- local defaults = {
- level=1,
- exp=0,
- prestige=0
- }
- -- Checking Level/Prestige
- function _p:CheckEXP() if self:GetEXP()>=(self:GetLevel()*config.exp_max) then self:LevelUp() end end
- function _p:CheckLevel() if self:GetLevel()>config.prestige_level then self:PrestigeUp() end end
- -- EXP
- function _p:SetEXP(amount) self:SetNWInt("_p_exp",amount) end
- function _p:GetEXP() return self:GetNWInt("_p_exp") end
- function _p:AddEXP(amount) self:SetEXP(self:GetEXP()+(amount*config.multiplier)) self:CheckEXP() end
- -- Level
- function _p:SetLevel(amount) self:SetNWInt("_p_level",amount) end
- function _p:GetLevel() return self:GetNWInt("_p_level") end
- function _p:AddLevel(amount) self:SetLevel(self:GetLevel()+amount) end
- -- Prestige
- function _p:SetPrestige(amount) self:SetNWInt("_p_prestige",amount) end
- function _p:GetPrestige() return self:GetNWInt("_p_prestige") end
- function _p:AddPrestige(amount) self:SetPrestige(self:GetPrestige()+amount) end
- -- Default
- function _p:LevelUp() self:AddLevel(1) self:SetEXP(0) self:CheckLevel() self:NotifyUp("Level " .. self:GetLevel(),(config.money_reward*m_multiplier)) end
- function _p:PrestigeUp() self:SetLevel(0) self:SetEXP(0) self:AddPrestige(1) self:NotifyUp("Prestige " .. self:GetLevel(),(config.p_money_reward*m_multiplier)) end
- function _p:DefaultLevels() self:SetEXP(defaults.exp) self:SetLevel(defaults.level) self:SetPrestige(defaults.prestige)end
- function _p:NotifyUp(text,reward) DarkRP.notify(self, 0, 4, text .. " Reward: " .. reward) self:AddMoney(reward) end
- -- Hooks
- -- Commands
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement