Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. AddCSLuaFile( "cl_init.lua" )
  2. AddCSLuaFile( "shared.lua" )
  3.  
  4. include('shared.lua')
  5.  
  6. function ENT:Initialize()
  7.  
  8. self:SetModel("models/props_lab/monitor01a.mdl")
  9. self:PhysicsInit(SOLID_VPHYSICS)
  10. self:SetMoveType(MOVETYPE_VPHYSICS)
  11. self:SetSolid(SOLID_VPHYSICS)
  12. self:SetUseType( SIMPLE_USE )
  13. self:SetPos(self:GetPos()+Vector(0,0,5))
  14. local phys = self:GetPhysicsObject()
  15. if IsValid(phys) then
  16. phys:Wake()
  17. end
  18.  
  19. plug = ents.Create( "ent_plug" )
  20. if ( !IsValid( plug ) ) then return end
  21. plug:SetPos( self:GetPos() + Vector( 50, 25, 0 ) )
  22. plug:SetAngles(self:GetAngles())
  23. plug:Spawn()
  24. plug.defaultDevice = self
  25.  
  26. self.rope = constraint.Rope( self, plug, 0, 0, Vector(-10,0,0), Vector(0,0,0), 200, 0, 9999999, 1, Material("cable/cable2"), false )
  27.  
  28. end
  29.  
  30.  
  31. function ENT:OnRemove()
  32. plug:Remove()
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement