Advertisement
Guest User

BOX 1

a guest
Dec 6th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. AddCSLuaFile()
  2.  
  3. ENT.Type = "anim"
  4. ENT.Base = "base_entity"
  5. ENT.PrintName = "Caixa"
  6. ENT.Author = "Dom"
  7. ENT.Spawnable = true
  8. ENT.AdminSpawnable = true
  9. ENT.Category = "FakeGasFactory"
  10.  
  11. if SERVER then
  12.  
  13. function ENT:Initialize()
  14. self:SetModel("models/props/cs_office/cardboard_box03.mdl")
  15. self:PhysicsInit(SOLID_VPHYSICS)
  16. self:SetMoveType(MOVETYPE_VPHYSICS)
  17. self:SetSolid(SOLID_VPHYSICS)
  18. self:SetCollisionGroup(COLLISION_GROUP_NONE)
  19. local phys = self:GetPhysicsObject()
  20. if phys and phys:IsValid() then
  21. phys:Wake()
  22. end
  23.  
  24. self.Cigarret = 0
  25. self.usebla = false
  26. end
  27.  
  28. function ENT:StartTouch(ent)
  29.  
  30. if ent:GetClass() == "cigarro" and self.Cigarret <= 9 then
  31. self.Cigarret = self.Cigarret + 1
  32. print(self.Cigarret)
  33. ent:Remove()
  34. end
  35.  
  36. if self.Cigarret == 10 then
  37. self:SetNWInt("Cigarrin", self.Cigarret)
  38. self.usebla = true
  39. end
  40. end
  41.  
  42. end
  43.  
  44. if CLIENT then
  45. function ENT:Initialize()
  46. end
  47.  
  48. function ENT:Draw()
  49. self:DrawModel()
  50. end
  51.  
  52. function ENT:Think()
  53. end
  54.  
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement