Entity Explosion Help


AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua")

include('shared.lua')

function ENT:Initialize()

	self:SetModel("models/weapons/w_slam.mdl")
	self:PhysicsInit( SOLID_VPHYSICS )
	self:SetMoveType( MOVETYPE_VPHYSICS )
	self:SetSolid( SOLID_VPHYSICS )
	
end 

function ENT:Use( activator, caller )
	if ( activator:IsPlayer() ) then

		activator:Kill()
		self:Ignite(igniteForSeconds,0)

        	local explosion = ents.Create( "env_explosion" ) 
        	explosion:SetKeyValue( "spawnflags", 144 ) 
        	explosion:SetKeyValue( "iMagnitude", 15 ) 
        	explosion:SetKeyValue( "iRadiusOverride", 256 ) 
        	explosion:SetPos(self:GetPos()) 
        	explosion:Spawn( ) 
        	explosion:Fire("explode","",0)
			timer.Create("timer",5,0,function() end )       	
        	self.Entity:Remove() 
	end
end

function ENT:Think()

end

My Explosion doesn’t kill anyone around me only me I don’t know why why

The reason only you are dying is due to activator:Kill( ), the script is killing you, you’re not dying from the env_explosion.

This is the CreateExplosion helper function I’m releasing in my skeleton game-mode, For reliable damage, use util.BlastDamage:
[lua]//
// CreateExplosion - with proper magnitude dispersement, damage, etc… - Josh ‘Acecool’ Moser
//
function CreateExplosion( _pos, _magnitude, _radius, _damage, _inflictorWeapon, _inflictorPlayer )
// Generate the damage from the explosion.
util.BlastDamage( _inflictorWeapon or game.GetWorld( ), _inflictorPlayer or game.GetWorld( ), _pos, _radius or _magnitude, _damage or 0 )

// Ensure that the entire magnitude is dispensed in 100 increments/intervals
local _times = math.ceil( _magnitude / 100 );	
for i = 0, _times - 1 do
	local _mag = ( _magnitude - ( i * 100 ) )

	// Generate the explosion / force of the explosion.
	local explosion = CreateEntity( "env_explosion" )
	
	// No damage just force, push players, disorient players if pushed
	explosion:SetKeyValue( "spawnflags", 1 + 2 + 16 );

	// Mag is clamped from 1 to 100 anyway
	explosion:SetKeyValue( "iMagnitude", math.Clamp( _mag, 1, 100 ) );

	// Radius or magnitude
	explosion:SetKeyValue( "iRadiusOverride", _radius or _magnitude );

	explosion:SetPos( _pos );
	explosion:Spawn( );

	// Touch-Off
	explosion:Fire( "Explode", "", 0 );

	// Remove it from the world
	explosion:Fire( "Kill", "", 0 );
end

end[/lua]

Thats makes alot of sense thank you