Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --init.lua--
- AddCSLuaFile ( "cl_init.lua" )
- AddCSLuaFile ( "shared.lua" )
- include ('shared.lua' )
- local Position = self.GetPos()
- function ENT.Initialize(self)
- self.Entity:SetModel( "models/props_lab/jar01b.mdl" )
- self.Entity:PhysicsInit( SOLID_VPHYSICS )
- self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
- self.Entity:SetSolid( SOLID_VPHYSICS )
- local phys = self.Entity:GetPhysicsObject()
- if (phys:IsValid()) then
- phys:Wake()
- end
- end
- function ENT:Use ( activator, caller )
- self:Remove()
- return
- end
- function ENT:Think()
- end
- --shared.lua--
- ENT.Type = "anim"
- ENT.Base = "base_gmodentity"
- ENT.PrintName = "Drug"
- ENT.Author = "Atwal"
- ENT.Contact = "None"
- ENT.Purpose = "Heal up"
- ENT.Instructions = "Click E to recieve affects"
- --cl_init.lua--
- include('shared.lua')
- function ENT:draw()
- self.DrawEntityOutline( 1.0 )
- self.Entity:DrawModel()
- end
- function ENT:Emit()
- local em = ParticleEmitter(Position)
- if math.random(1,5) == 3 then
- local part = em:Add("sprites/light_glow02_add", Position)
- if part then
- part:SetColor(0,255,0,math.random(255))
- part:SetVelocity(Vector(math.random(-1,1),math.random(-1,1),math.random(-1,1)):GetNormal() * 20)
- part:SetDieTime(0.5)
- part:SetLifeTime(0)
- part:SetStartSize(10)
- part:SetEndSize(0)
- end
- em:Finish()
- end
- end
- hook.Add( "Think", "Particle", ENT:Emit() )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement