AddCSLuaFile() ENT.Type = "anim" ENT.Base = "base_anim" ENT.Spawnable = false function ENT:Draw() self.Entity:DrawModel() end function ENT:Initialize() if SERVER then self.Entity:SetModel( "models/csgo/weapons/w_eq_fraggrenade_thrown.mdl" ) self.Entity:SetMoveType( MOVETYPE_VPHYSICS ) self.Entity:SetSolid( SOLID_VPHYSICS ) self.Entity:PhysicsInit( SOLID_VPHYSICS ) self.Entity:SetCollisionGroup( COLLISION_GROUP_WEAPON ) self.Entity:DrawShadow( true ) end self.ExplodeTimer = CurTime() + 1.5 end function ENT:Think() if SERVER and self.ExplodeTimer <= CurTime() then self.Entity:Remove() end end function ENT:PhysicsCollide( data ) if SERVER and data.Speed > 150 then self.Entity:EmitSound( "CSGO_HEGrenade.Bounce" ) end end function ENT:OnRemove() if SERVER then local explode = ents.Create( "env_explosion" ) explode:SetOwner( self.Owner ) explode:SetPos( self:GetPos() ) explode:Spawn() explode:Fire( "Explode", 0, 0 ) self.Entity:EmitSound( "CSGO_BaseGrenade.Explode" ) end util.BlastDamage( self, self.Owner, self:GetPos(), 350, 99 ) end