Physgun darkrp ents Sleep freeze

This allows players to physgun their darkrp ents (that they own) like printers, and gun labs, it also allows them to freeze the entities without locking them in place
if anything touches the entities it will unfreeze them
grav gunning the entities will unfreeze them

[lua] hook.Add("OnPhysgunFreeze", "darkrpentfreeze", function(weapon, physobj, ent, ply ) if (ent.dt != nil) and (ent.dt.owning_ent != nil) then if ent.dt or ent.dt.owning_ent then physobj:Sleep() return false end end end)

function EOTI_PlayerPickup(ply, ent)
if (ent:GetOwner() == ply
or ent:GetNWEntity(“owner”) == ply)
then return true end
end

function EOTI_SetOwner(ply,tbl,ent)
if ent:GetNWEntity(“owner”) == “[NULL ENTITY]” then return end
ent:SetNWEntity( “owner” , ply )
end

function EOTI_SetOwnerVehicle(ply,ent)
if ent:GetNWEntity(“owner”) == “[NULL ENTITY]” then return end
ent:SetNWEntity( “owner” , ply )
end

hook.Add( “playerBoughtCustomEntity”, “EOTI_SpawnPropOwner”, EOTI_SetOwner )
hook.Add( “playerBoughtCustomVehicle”, “EOTI_SpawnPropOwner”, EOTI_SetOwner )
hook.Add( “playerBoughtPistol”, “EOTI_SpawnPropOwner”, EOTI_SetOwner )
hook.Add( “playerBoughtShipment”, “EOTI_SpawnPropOwner”, EOTI_SetOwner )
hook.Add( “playerBoughtAmmo”, “EOTI_SpawnPropOwner”, EOTI_SetOwner )
hook.Add( “playerBoughtVehicle”, “EOTI_SpawnPrVehicle”, EOTI_SetOwnerVehicle )
hook.Add(“PhysgunPickup”, “EOTI_PhysgunAllItem”, EOTI_PlayerPickup )

[/lua]

(only the first 10 lines are me the rest are from this addon http://steamcommunity.com/sharedfiles/filedetails/?id=430483871 )

place in lua/autorun/server

I was gonna say it’s a dumb script, because you can achieve the same thing by just meddling with FPP, but then I saw the part about gravgunning and that’s a quite decent idea.

lol i was allowing phys gunning of printers and such on my server (so much easier to manipulate )
but had people complain that you couldn’t steal the printers. i didn’t want to remove the phys gunning so i figured why not sleep XD

[editline]22nd September 2015[/editline]

side note, make sure grav gunning blocked ents are allowed

welp this doesnt seem to actually work in a multiplayer environment or i have a conflicting addon XD all it does is keep you from freezing the entity but it fails to make it sleep in multiplayer well regardless it adds physguning darkrp ents without freezing them