Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. AddCSLuaFile("cl_init.lua")
  2. AddCSLuaFile("shared.lua")
  3.  
  4.  
  5.  
  6.  
  7. include("shared.lua")
  8.  
  9. local interval = 1
  10.  
  11. function ENT:Initialize()
  12.  
  13. self:SetModel("models/props_c17/FurnitureDresser001a.mdl")
  14. self:PhysicsInit(SOLID_VPHYSICS)
  15. self:SetMoveType(MOVETYPE_VPHYSICS)
  16. self:SetSolid(SOLID_VPHYSICS)
  17.  
  18. local phys = self:GetPhysicsObject()
  19.  
  20. if phys:IsValid() then
  21.  
  22. phys:Wake()
  23.  
  24. end
  25. --timer.Simple(1, function() self:SetPos(self:GetPos() + Vector(0,0, 30) ) end)
  26.  
  27. end
  28.  
  29.  
  30.  
  31. function ENT:Use(activator, caller)
  32.  
  33. if not activator.reading then
  34. if not ( activator:getDarkRPVar("job") == "Gryffindor" or activator:getDarkRPVar("job") == "Gryffindor Prefect" or activator:getDarkRPVar("job") == "Slytherin" or activator:getDarkRPVar("job") == "Slytherin Prefect" or activator:getDarkRPVar("job") == "Ravenclaw" or activator:getDarkRPVar("job") == "Ravenclaw Prefect" or activator:getDarkRPVar("job") == "Hufflepuff" or activator:getDarkRPVar("job") == "Hufflepuff Prefect" or activator:getDarkRPVar("job") == "Slytherin Head Prefect" or activator:getDarkRPVar("job") == "Quidditch Coach" ) or not ( activator:getDarkRPVar("level") > 3 ) then
  35. activator:PrintMessage(HUD_PRINTTALK, "You don't have enough level or you're not in the right job." )
  36. activator.reading = true
  37.  
  38. timer.Simple(3,function() activator.reading = false end)
  39.  
  40. return
  41. end
  42.  
  43. if activator.brooms == 0 or not activator.brooms then
  44. activator.reading = true
  45. activator.brooms = 1
  46. timer.Simple(3,function() activator.reading = false end)
  47.  
  48. local broom = ents.Create("kekc_broom_ent")
  49. broom:SetPos( self:GetPos() + Vector(20,0, 10) )
  50. broom:SetAngles(Angle(180, 90, 0))
  51. broom:CreateGhost()
  52. broom:Spawn()
  53. broom:CreateGhost()
  54. broom.owner = activator:GetName()
  55.  
  56. else
  57. activator:PrintMessage(HUD_PRINTTALK, "You already spawned one broom!" )
  58. activator.reading = true
  59. timer.Simple(3,function() activator.reading = false end)
  60.  
  61. end
  62. end
  63.  
  64.  
  65. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement