Advertisement
Guest User

Untitled

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