Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddCSLuaFile("cl_init.lua")
- AddCSLuaFile("shared.lua")
- include("shared.lua")
- local interval = 1
- function ENT:Initialize()
- self:SetModel("models/props_c17/FurnitureDresser001a.mdl")
- self:PhysicsInit(SOLID_VPHYSICS)
- self:SetMoveType(MOVETYPE_VPHYSICS)
- self:SetSolid(SOLID_VPHYSICS)
- local phys = self:GetPhysicsObject()
- if phys:IsValid() then
- phys:Wake()
- end
- --timer.Simple(1, function() self:SetPos(self:GetPos() + Vector(0,0, 30) ) end)
- end
- function ENT:Use(activator, caller)
- if not activator.reading then
- 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
- activator:PrintMessage(HUD_PRINTTALK, "You don't have enough level or you're not in the right job." )
- activator.reading = true
- timer.Simple(3,function() activator.reading = false end)
- return
- end
- if activator.brooms == 0 or not activator.brooms then
- activator.reading = true
- activator.brooms = 1
- timer.Simple(3,function() activator.reading = false end)
- local broom = ents.Create("kekc_broom_ent")
- broom:SetPos( self:GetPos() + Vector(20,0, 10) )
- broom:SetAngles(Angle(180, 90, 0))
- broom:CreateGhost()
- broom:Spawn()
- broom:CreateGhost()
- broom.owner = activator:GetName()
- else
- activator:PrintMessage(HUD_PRINTTALK, "You already spawned one broom!" )
- activator.reading = true
- timer.Simple(3,function() activator.reading = false end)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement