Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. /*---------------------------------------------------------------------------
  2. Perks - these are unlockables you get by achieving certain levels, you can set it to unlock jobs, unlock entities,
  3. give a one time cash bonus, increase health and a lot more as long as you know the very basics of lua or follow
  4. the examples below.
  5.  
  6. --first template
  7. local perk = {}
  8. perk.name = "[name]"
  9. perk.descripion = "[description]"
  10. perk.icon = "[icon.png]"
  11. perk.level = 0 --level required to use
  12. perk.useCost = 0 --only works for active perks, takes exp on usage
  13. perk.restriction = function( ply ) return true end --this gets executed before below functions are, to prevent some exploits
  14. perk.passive = function( ply ) end --this function will be executed on player spawn
  15. perk.active = function( ply ) end --this function will be executed on player usage of perk
  16. perk.event = function( ply ) end --this function will be executed once, on level up
  17. levelup.config.addPerk( perk )
  18.  
  19. --second template
  20. local perk =
  21. {
  22. name = ""
  23. description = ""
  24. icon = ""
  25. level = 0
  26. perk.useCost = 0
  27. restriction = function( ply ) return true end
  28. passive = function( ply ) end
  29. active = function( ply ) end
  30. event = function( ply ) end
  31. }
  32. ---------------------------------------------------------------------------*/
  33. levelup.perks = {}
  34.  
  35.  
  36.  
  37. local perk = {}
  38. perk.name = "level 19!"
  39. perk.description = "2000 PS points"
  40. perk.icon = "key.png"
  41. perk.level = 19
  42. perk.event = function( ply )
  43. local points, premiumPoints = 0, 0
  44. if ply.PS2_Wallet
  45. then
  46. points, premiumPoints = ply.PS2_Wallet.points, ply.PS2_Wallet.premiumPoints
  47. ply:PS2_AddStandardPoints(2000)
  48. end
  49. end
  50. levelup.config.addPerk( perk )
  51.  
  52. local perk = {}
  53. perk.name = "level 20!"
  54. perk.description = "2000 PS points"
  55. perk.icon = "key.png"
  56. perk.level = 20
  57. perk.event = function( ply )
  58. local points, premiumPoints = 0, 0
  59. if ply.PS2_Wallet
  60. then
  61. points, premiumPoints = ply.PS2_Wallet.points, ply.PS2_Wallet.premiumPoints
  62. ply:PS2_AddStandardPoints(2000)
  63. end
  64. end
  65. levelup.config.addPerk( perk )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement