Hi, so I’m new to GMOD Lua and I’m trying to create a command where I can get ownership of a door so that I can lock and unlock that particular door. I’ve got the basis of this concept working, however since I’m using “Entity:SetOwner” it’s removing all physics of that door. My question is this, is there some method of applying ownership to a door based on the entity that your looking at and still have that prop with full physics? Thanks.
Here’s my buydoor code:
function buyDoor( ply ) local eyes = ply:GetEyeTrace() local ent = eyes.Entity if IsValid( ent ) then ent:SetOwner(ply) ply:ChatPrint( "You've purchased door: " .. ent:EntIndex() ) end end concommand.Add( "buyDoor", buyDoor )