Cant set owner of an entity

I made a kind of sticky launcher / grenade launcher so when it hits a person they get hurt and dies but then the killer is #mine (im in gmod 13) but in my SWEP I use this code:

local ent = ents.Create(“mine”)

ent:SetOwner(self.Owner)
ent:Spawn()

Please help me :slight_smile:

When you kill someone with an entity it will never display the owners name unless you tell it to I believe. You’ll have to tell the game who the attacker is. The best way IMO the Entity:TakeDamage function and just pass in self.Owner when you inflict the damage.

http://bananatree.im/wiki/wiki.garrysmod.com/index8b03.html?title=Entity.TakeDamage