overloads and crashes every time

What’s wrong with this function?

[lua]
function ENT:CatastrophicFailure(activatorperson)

local effectdata=EffectData()
local Pos=self:GetPos()
effectdata:SetMagnitude(1)
effectdata:SetOrigin(Pos)
effectdata:SetScale(23000)
util.Effect("warpcore_breach",effectdata)

self:EmitSound("explode_9")

local blastradius=2000
util.BlastDamage(self,activatorperson,self:GetPos(),blastradius,1000)
for key,found in pairs(ents.FindInSphere(Pos,blastradius)) do
	
	if(found:IsPlayer())then
		found:SetModel("models/player/charple01.mdl")
	end
end

self:Remove()

end
[/lua]

When it’s called upon, it crashes gmod. I can tell that it overloads with effects, as it causes my graphics whatever to fail. This is copied from LifeSupport (and we all know what the LS fusion genny explosion looks like) and the SetScale(23000) is correct.

If there’s nothing wrong with the function itself, maybe my ENT is calling it more than once… I will post my ENT code if you think that’s the case.

By you using the argument activatorperson, I’m guessing this is being called from ENT:Use? If so, make sure you do ENT:SetUseType(SIMPLE_USE) to avoid the use function being called more than once.

I got it. The entity was doing things to itself that made this function call several times before the entity was removed. Thanks, though.