Advertisement
Guest User

Untitled

a guest
Sep 13th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. function AddEXP( ply, hitgroup, dmginfo )
  2. local attacker = dmginfo:GetAttacker()
  3. if attacker:IsPlayer() then
  4. if attacker:IsUserGroup("VIP") then
  5. if EXP_STOPATMAX == 1 and attacker:GetNWInt("CurLevel") == levelups[table.Count(levelups)] then return end
  6. attacker:SetNWInt("Exp",attacker:GetNWInt("Exp")+2)
  7. Msg("VIP exp")
  8. else
  9. if EXP_STOPATMAX == 1 and attacker:GetNWInt("CurLevel") == levelups[table.Count(levelups)] then return end
  10. attacker:SetNWInt("Exp",attacker:GetNWInt("Exp")+EXP_INC)
  11. Msg("Normal exp")
  12. end
  13.  
  14.  
  15. if table.HasValue(levelups,attacker:GetNWInt("Exp")) then
  16. local leveln = 1
  17. for k,v in ipairs(levelups) do if v == attacker:GetNWInt("Exp") then leveln = k end end
  18. if leveln == table.Count(levelups) then PrintAll(attacker:Name().." has reached the maximum level!")
  19. else PrintAll(attacker:GetName().." has now reached level "..leveln.."!") end
  20. attacker:SetNWInt("NextLevel",levelups[leveln+1])
  21. attacker:SetNWInt("CurLevel",levelups[leveln])
  22. attacker:SetNWInt("LevelNum",leveln)
  23. attacker:SendLua("surface.PlaySound(\"achievements/achievement_earned.mp3\")")
  24. end
  25.  
  26. end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement