need help with entity looking for owner

I don’t know what I am doing wrong. all i am trying to do is when the player touches the entity and that player is the owner of that entity he gets ammo.
this is what i did.

[lua]
function ENT:Touch(hitEnt)
if hitEnt:CPPIGetOwner(self.Owner) then
hitEnt:GiveAmmo(100,“smg1”)
self.Entity:Remove()
end
end
[/lua]

its not showing any errors but its not worknig.

btw i am using falo’s prop protection.

is there any other way to do this ?

I’m not familiar with ‘falo’s prop protection’, but wouldn’t this…

[lua]function ENT:Touch(hitEnt)
if !self.Owner or !self.Owner:IsValid() or !hitEnt:IsValid() then return end
if self.Owner == hitEnt then
hitEnt:GiveAmmo(100,“smg1”)
self.Entity:Remove()
end
end[/lua]

…be what you want?