Entity spawned by stool problem.

Hello.

I need litle help. If one player spawn one entity with toolgun can i get the player and the entity with lua?

So i wanna place these entityes on the player Cleanup list. I have some problem with Falco’s prop protection, lot of entityes owner is the world if i place it, and i don’t wanna fix all stool on my server to place these entityes on the player cleanup list :S

I hope somebody can help me. And sorry about my bad english.

hook into **[Gamemode.PlayerSpawnedProp

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

[editline]04:28PM[/editline]

[lua]hook.Add(“PlayerSpawnedProp”, “PlayerHasSpawnedaProp”, function(ply, ent)
– Do what you want to do with ply and ent.
end)[/lua]

thank you but this only work with prop physics :frowning:

Right, I didn’t read your post properly.

You will have to edit the toolgun in order to detect when the entity is created then.