Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. cl.init.lua
- include( "entities\druglab\shared.lua" )
- function ENT:Draw()
- self:DrawModel()
- end
- 2. init.lua
- AddCSLuaFile("cl_init.lua")
- AddCSLuaFile("shared.lua")
- include("shared.lua")
- function ENT:Initialize()
- self:SetModel("models/props_c17/TrapPropeller_Engine.mdl")
- self:SetColor( Color(100, 100, 255, 125 ) )
- self:PhysicsInit( SOLID_VPHYSICS )
- self:SetMoveType( MOVETYPE_VPHYSICS )
- self:SetSolid( SOLID_VPHYSICS )
- self:Ignite()
- timer.Simple( 5, function()
- if( self:IsValid() ) then
- self:Remove()
- end
- end)
- local phys = self:GetPhysicsObject()
- if( phys:IsValid() ) then
- phys:Wake()
- end
- end
- function ENT:Use( caller, activator )
- activator:SetHealth( 300 )
- end
- function ENT:Touch( entity )
- if( !entity:IsPlayer() ) then return end
- entity:Kill()
- end
- function ENT:Think()
- self:SetColor( Color( math.Random( 0,255), math.Random( 0,255), math.Random( 0,255) ))
- end
- 3. shared.lua file
- ENT.Type = "anim"
- ENT.Base = "base_gmodentiy"
- ENT.PrintName = "DrugLab"
- ENT.Instructions = "Touch me"
- ENT.Spawnable = true
- ENT.AdminSpawnable = true
- ENT.Author = ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement