How do you do stuff to an entity's owner?

How do you do stuff to an entity’s owner? I wrote a big script using self.Owner:(function here). And I realized that you could only use that in SWEPs. How do I get an entity’s owner and do stuff to him?
Please reply ASAP, I am moving out of internet connection soon.
Thanks!

By default props do not have owners or any system to set it, so there is no way to get it using default functions. You best bet is figuring out where the PP you are using stores it and get it from there. The owner is an player-entity so you can do whatever to it using what you are currently doing.

Excuse me, but what is a PP?

Prop protection.

**[Entity.GetOwner

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Entity.GetOwner)**

[editline]27th March 2011[/editline]

But thanks for trying.

True, then what do you want exactly? The person who spawned the entity?

**[Gamemode.PlayerSpawnedProp

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.PlayerSpawnedProp)**

[lua]
hook.Add(“PlayerSpawnedProp”,“AssignVar”,function(ply,model,ent)
ent.Player = ply
end)
[/lua]

Assuming you wanted to do this to props.

You can use sort of the same way for any entity.

Thanks. I’ll use PlayerSpawnedSent.

[editline]27th March 2011[/editline]

In ENT:SpawnFunction(ply, tr) is ply the player who is spawning it?

Yes.

Yay!
Thanks for all the help!