AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) include('shared.lua') function ENT:Initialize() math.randomseed(CurTime()) //self.firesound = "spacemarine/plasma_rifle.wav" local glow = ents.Create( "env_sprite" ) glow:SetKeyValue( "rendercolor","255 128 0" ) glow:SetKeyValue( "GlowProxySize","2.0" ) glow:SetKeyValue( "HDRColorScale","1.0" ) glow:SetKeyValue( "renderfx","14" ) glow:SetKeyValue( "rendermode","3" ) glow:SetKeyValue( "renderamt","255" ) glow:SetKeyValue( "disablereceiveshadows","0" ) glow:SetKeyValue( "mindxlevel","0" ) glow:SetKeyValue( "maxdxlevel","0" ) glow:SetKeyValue( "framerate","10.0" ) glow:SetKeyValue( "model","sprites/blueflare1.spr" ) glow:SetKeyValue( "spawnflags","0" ) glow:SetKeyValue( "scale","0.75" ) glow:SetPos( self.Entity:GetPos() ) glow:Spawn() glow:SetParent( self.Entity ) self.exploded = false self.Entity:SetModel( "models/dav0r/hoverball.mdl" ) //self.Entity:SetModel( "models/weapons/w_bugbait.mdl" ) self.Entity:PhysicsInit( SOLID_VPHYSICS ) -- Make us work with physics, self.Entity:SetMoveType( MOVETYPE_VPHYSICS ) --after all, gmod is a physics self.Entity:SetSolid( SOLID_VPHYSICS ) -- Toolbox self.Entity:SetMaterial("models/props_lab/Tank_Glass001") //self.Entity:SetColor(0,191,255,235) self.Entity:Ignite( 120, 40 ) self.dietime = CurTime() + 3 //self.Entity:EmitSound( self.firesound , 500 , 100 ) local phys = self.Entity:GetPhysicsObject() if (phys:IsValid()) then phys:Wake() phys:EnableGravity(false) end //self:SetGravity(0.25) end function ENT:OnTakeDamage( dmginfo ) self.Entity:TakePhysicsDamage( dmginfo ) end function ENT:PhysicsCollide() if ( self.exploded == false) then util.BlastDamage(self.Entity, self.Entity, self.Entity:GetPos(), 12, 5) local effectdata = EffectData() effectdata:SetOrigin(self.Entity:GetPos()) util.Effect( "ImpactGunship", effectdata ) self.exploded = true end end function ENT:Think() if ( self.dietime < CurTime() ) then util.BlastDamage(self.Entity, self.Entity, self.Entity:GetPos(), 12, 5) local effectdata = EffectData() effectdata:SetOrigin(self.Entity:GetPos()) //util.Effect( "ImpactGunship", effectdata ) self.exploded = true end if self.exploded == true then self:Remove() end self:NextThink( CurTime() ) return true end