Advertisement
GlorifiedPig

Untitled

Sep 20th, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. if SERVER then
  2. AddCSLuaFile()
  3. resource.AddFile("class_system/sound/changeclass.wav")
  4. end
  5. HogwartsRP_class = 1
  6.  
  7. HogwartsRP_ClassList = {
  8. [1] = "Free Time",
  9. [2] = "Class 1/Charms",
  10. [3] = "Class 3/Def. Against the DF",
  11. [4] = "Free Time",
  12. [5] = "Hagrid's Place",
  13. [6] = "Class 1/Def. Against the DF",
  14. [7] = "Astronomy Tower",
  15. [8] = "Free Time",
  16. [9] = "Challenge and Battle Room",
  17. [10] = "Battle Room",
  18. [11] = "Lockdown",
  19. [12] = "Class 1/Study of Occlumency",
  20. [13] = "Class 3/Transfiguration Class",
  21. [14] = "Grand Hall/Cafeteria Time",
  22. [15] = "Class 1/Charms Class",
  23. [16] = "Free Time",
  24. [17] = "Quiditch/Competition",
  25. [18] = "Class 5/Study of Muggles",
  26. [19] = "Free Time",
  27. [20] = "Class 1/Charms Class",
  28. [21] = "Class 5/History Class",
  29. [22] = "Study of Herbology",
  30. [23] = "Class 4/Potion Class",
  31. [24] = "Free time",
  32. [25] = "Class 1/Charms Class",
  33. [26] = "Class 3/Def. Against the DF",
  34. [27] = "Challenge and Battle Room",
  35. [28] = "Free Time",
  36. [29] = "Hagrid's Place",
  37. [30] = "Class 1/Def. Against the DF",
  38. [31] = "Astronomy Tower",--
  39. }
  40.  
  41. if SERVER then
  42.  
  43. timer.Create("NextClassBegins",360,0,function()
  44.  
  45. HogwartsRP_class = HogwartsRP_class + 1
  46.  
  47. if HogwartsRP_class > table.Count(HogwartsRP_ClassList) then HogwartsRP_class = 1 end
  48.  
  49. for k,ply in pairs(player.GetAll()) do
  50.  
  51. ply:SetNWFloat( "HWRP_Class", HogwartsRP_class )
  52. ply:SendLua("surface.PlaySound(\"class_system/sound/changeclass.wav\")")
  53.  
  54. end
  55.  
  56.  
  57. end)
  58.  
  59.  
  60. local function PlyInitSpawn(ply)
  61.  
  62. ply:SetNWFloat( "HWRP_Class", HogwartsRP_class )
  63.  
  64. end
  65. hook.Add("PlayerInitialSpawn","SyncClass",PlyInitSpawn)
  66.  
  67. else
  68. hook.Add("HUDPaint","DrawClassDisplay",function()
  69. if HogwartsRP_ClassList[LocalPlayer():GetNWFloat("HWRP_Class")] != nil then
  70. surface.SetFont("HarryPFont")
  71. local add = surface.GetTextSize(HogwartsRP_ClassList[LocalPlayer():GetNWFloat("HWRP_Class")])
  72. draw.RoundedBox(10,9,20,100 + add,90,Color(28,28,28,150))
  73. draw.RoundedBox(10,10,21,98 + add,88,Color(28,28,28,150))
  74. draw.SimpleText(HogwartsRP_ClassList[LocalPlayer():GetNWFloat("HWRP_Class")],"HarryPFont",60,55,Color(255,255,255,255))
  75.  
  76. end
  77.  
  78.  
  79.  
  80. end)
  81.  
  82.  
  83. end
  84. if CLIENT then
  85. surface.CreateFont( "HarryPFont", {
  86. font = "Harry P",
  87. extended = false,
  88. size = 32,
  89. weight = 500,
  90. blursize = 0,
  91. scanlines = 0,
  92. antialias = true,
  93. underline = false,
  94. italic = false,
  95. strikeout = false,
  96. symbol = false,
  97. rotary = false,
  98. shadow = false,
  99. additive = false,
  100. outline = false,
  101. } )
  102. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement