Guest User

Untitled

a guest
Oct 21st, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. function getLevel(ply) --returns a player level
  2. local level = 0
  3. local xp = ply:GetXP()
  4. for k, v in ipairs(Level) do
  5. //print(k .. ":" .. v)
  6. if(xp >= v) and ply:IsValid() then
  7. level = level + 1
  8. if (level == 10 && !sqlDonator) then -- non-donators can't go past level 10 even though they continue to gain experience.
  9. ply:SetNWInt("level", level)
  10. return level
  11. end
  12. else
  13. ply:SetNWInt("level", level)
  14. return level
  15. end
  16. end
  17. ply:SetNWInt("level", level)
  18. return level -- fallback
  19. end
Add Comment
Please, Sign In to add comment