Advertisement
Guest User

Untitled

a guest
May 20th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. 1. cl.init.lua
  2.  
  3.  
  4. include( "entities\druglab\shared.lua" )
  5.  
  6. function ENT:Draw()
  7.  
  8. self:DrawModel()
  9.  
  10. end
  11.  
  12.  
  13. 2. init.lua
  14.  
  15.  
  16. AddCSLuaFile("cl_init.lua")
  17. AddCSLuaFile("shared.lua")
  18.  
  19. include("shared.lua")
  20.  
  21. function ENT:Initialize()
  22.  
  23. self:SetModel("models/props_c17/TrapPropeller_Engine.mdl")
  24. self:SetColor( Color(100, 100, 255, 125 ) )
  25.  
  26. self:PhysicsInit( SOLID_VPHYSICS )
  27. self:SetMoveType( MOVETYPE_VPHYSICS )
  28. self:SetSolid( SOLID_VPHYSICS )
  29.  
  30. self:Ignite()
  31.  
  32. timer.Simple( 5, function()
  33. if( self:IsValid() ) then
  34. self:Remove()
  35. end
  36. end)
  37.  
  38. local phys = self:GetPhysicsObject()
  39.  
  40. if( phys:IsValid() ) then
  41. phys:Wake()
  42. end
  43. end
  44.  
  45. function ENT:Use( caller, activator )
  46. activator:SetHealth( 300 )
  47.  
  48. end
  49.  
  50. function ENT:Touch( entity )
  51.  
  52. if( !entity:IsPlayer() ) then return end
  53. entity:Kill()
  54. end
  55.  
  56. function ENT:Think()
  57. self:SetColor( Color( math.Random( 0,255), math.Random( 0,255), math.Random( 0,255) ))
  58. end
  59.  
  60. 3. shared.lua file
  61.  
  62. ENT.Type = "anim"
  63. ENT.Base = "base_gmodentiy"
  64.  
  65. ENT.PrintName = "DrugLab"
  66. ENT.Instructions = "Touch me"
  67. ENT.Spawnable = true
  68. ENT.AdminSpawnable = true
  69.  
  70. ENT.Author = ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement