function ENT:Use () question

Hi everybody , i’m got a little problem with this function /

I try to do a simple use and remove entity so i have try this :

function ENT:Use(owner)
local owner = self.Entity.dt.owning_ent
self:Remove();
end

I can delete the entity but other people can do this to but there aren’t owner …

I have test many issue like ent.owner / self.FPPOwner , etc , but that don’t work .

If that can help you for the answer this is the owner fonction on the function ENT:Initialize() :

self.FPPOwner = self.dt.owning_ent
self.FPPOwnerID = self.dt.owning_ent:SteamID()

Thanks you in advance if you can help me and sorry for my bad english .

I’m assuming you’re using DarkRP, which uses FPP (subsequently CPPI). Try calling self:CPPISetOwner() somewhere in the Initialize code. Also, what is self.Entity.dt.owning_ent?

So you say i have to try :

function ENT:Initialize()
self:SetModel(“models/props_c17/fence01b.mdl”);
self:PhysicsInit(SOLID_VPHYSICS);
self:SetHealth(TDN_sbarriere_Health);
self:SetMoveType(MOVETYPE_VPHYSICS);
self:SetSolid(SOLID_VPHYSICS);
self:SetNWBool(“explode”, false);
self:CPPISetOwner(self.dt.owning_ent)
self.SID = self.dt.owning_ent.SID

if TDN_sbarriere_GravityGun then
	self:GetPhysicsObject():SetMass(105);
end;	

end;

function ENT:Use(owner)
local owner = self:CPPISetOwner
self:Remove();
end

?

Use [lua] tags.

Solved , thanks So Much to ** Lolcats **