Entity wont blow up

Hi. My entity wont blow up on take damage.

[lua]
function ENT:OnTakeDamage(dmg)
self.damage = self.damage - dmg:GetDamage()
if (self.damage <= 0) then
local pos = self:GetPos()
local eData = EffectData()
eData:SetStart(pos)
eData:SetOrigin(pos)
eData:SetScale(1)
util.Effect(“Explosion”, eData)
self.Entity:Remove()
end
end
[/lua]

[lua]self.isReady = false
self.isPlantable = true
self.damage = 400
self.magic = false[/lua]

And where you set self.damage? Try print(self.damage) after that subtraction to see what’s happening.

[lua]unction ENT:Initialize()
self:SetModel(“models/props_wasteland/kitchen_stove001a.mdl”)
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
self:SetUseType(SIMPLE_USE)

local phys = self:GetPhysicsObject()
if IsValid(phys) then phys:Wake() end

self.isReady = false
self.isPlantable = true
self.damage = 400
self.magic = false
timer.Simple(0, function()
	if self:GetStage() and self:GetStage()&gt;0 then
		self:BeginStage(self:GetStage())
		self.isPlantable = false
	else
		self:SetStage(0)
	end
end)

end[/lua]

The print dosent do anything, the entity get’s removed, it just dosent explode.



local effectdata = EffectData()
effectdata:SetOrigin( pos )
util.Effect( "explosion", effectdata, true, true )

From emitter tool.

I also have this error.

Error creating ‘gmod_ghost’ (Make sure the file is AddCSLuaFile’d and there aren’t any errors.

Make sure the file is AddCSLuaFile’d and there aren’t any errors.

Didnt Work.

[lua]function ENT:OnTakeDamage(dmg)
self.damage = self.damage - dmg:GetDamage()
if (self.damage <= 0) then
local pos = self:GetPos()
local eData = EffectData()
eData:SetStart(pos)
eData:SetOrigin(pos)
eData:SetScale(1)
util.Effect( “explosion”, eData, true, true )
self.Entity:Remove()
end
end[/lua]

The Entity does not blow up.

[editline]7th June 2014[/editline]

Read what he said!