Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. function ENT:OnTakeDamage(dmg)
  2. local woodcuttingskill = dmg:GetAttacker():getChar():getData("Skill_Woodcutting")
  3. if !IsValid(dmg:GetAttacker()) or !dmg:GetAttacker():IsPlayer() then return end
  4. --if woodcuttingskill <= 24 then dmg:GetAttacker():notify ("You need atleast have level 25 woodcutting to chop this!") return end
  5. if table.HasValue(SWM_CUTTING_TOOLS, dmg:GetInflictor():GetClass()) or table.HasValue(SWM_CUTTING_TOOLS, dmg:GetAttacker():GetActiveWeapon():GetClass()) then
  6.  
  7. local xproll = math.random(25, (100 + math.random(0,woodcuttingskill)))
  8. local randomeventprobability = math.random(0, 1000)
  9.  
  10. self:SetNWInt("health", self:GetNWInt("health") - math.random(0, 2))
  11. dmg:GetAttacker():getChar():setData("EXP", dmg:GetAttacker():getChar():getData("EXP") + xproll)
  12. dmg:GetAttacker():AddXP(0)
  13. dmg:GetAttacker():notify("You've gained " .. xproll .. " EXP from woodcutting!")
  14. --print(randomeventprobability)
  15. if CLIENT then
  16. hook.Run("HUDPaint", "draw_xp_gain", XP.drawGainNotification)
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement