Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ENT:OnTakeDamage(dmg)
- local woodcuttingskill = dmg:GetAttacker():getChar():getData("Skill_Woodcutting")
- if !IsValid(dmg:GetAttacker()) or !dmg:GetAttacker():IsPlayer() then return end
- --if woodcuttingskill <= 24 then dmg:GetAttacker():notify ("You need atleast have level 25 woodcutting to chop this!") return end
- if table.HasValue(SWM_CUTTING_TOOLS, dmg:GetInflictor():GetClass()) or table.HasValue(SWM_CUTTING_TOOLS, dmg:GetAttacker():GetActiveWeapon():GetClass()) then
- local xproll = math.random(25, (100 + math.random(0,woodcuttingskill)))
- local randomeventprobability = math.random(0, 1000)
- self:SetNWInt("health", self:GetNWInt("health") - math.random(0, 2))
- dmg:GetAttacker():getChar():setData("EXP", dmg:GetAttacker():getChar():getData("EXP") + xproll)
- dmg:GetAttacker():AddXP(0)
- dmg:GetAttacker():notify("You've gained " .. xproll .. " EXP from woodcutting!")
- --print(randomeventprobability)
- if CLIENT then
- hook.Run("HUDPaint", "draw_xp_gain", XP.drawGainNotification)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement