Add frags to owner of entity on remove

How can i add Frags with AddFrags() to the owner of a Entity if the Entity gets removed?

I used the serach function first but i didnt find anything D:

http://wiki.garrysmod.com/?title=ENT.OnRemove then add the frags

If i do that i cant spawn the entity D:

If you mean for any entity, it would be like this:

[lua]function GiveFrags(ent)
ent:GetOwner():AddFrags(1)
end
hook.Add(“EntityRemove”,“GiveFrags”,GiveFrags)[/lua]

Bear in mind, when you spawn an entity, SetOwner is not called on the entity. You have to manually set up a system of ownership.

thx