Prop Phasing

So, currently, I have


local function MakeSolid( ply, ent )
	if not IsValid(ent) then return end
	ent:SetCollisionGroup( COLLISION_GROUP_NONE )
end
hook.Add("OnPhysgunFreeze", "MakeSolid", MakeSolid)

local function MakeNonSolid( ply, ent )
	if not IsValid(ent) then return end
	if ent:GetClass() == "prop_physics" then
		ent:SetCollisionGroup( COLLISION_GROUP_DEBRIS )
	end
end
hook.Add("PhysgunPickup", "MakeNonSolid", MakeNonSolid)

This makes the props phase out when you grab them, but they don’t phase back in or freeze when you right click. Did I do something wrong/is there a better way to do this?

You have to return true to allow.

[lua]local function MakeSolid( ply, ent )
if not IsValid(ent) or !ent.OldCollissionGroup then return end
ent:SetCollisionGroup( ent.OldCollissionGroup )
end
hook.Add(“OnPhysgunFreeze”, “MakeSolid”, MakeSolid)

local function MakeNonSolid( ply, ent )
if not IsValid(ent) then return end
if ent:GetClass() == “prop_physics” then
ent.OldCollissionGroup = ent:GetCollisionGroup( )
ent:SetCollisionGroup( COLLISION_GROUP_DEBRIS )
end
end
hook.Add(“PhysgunPickup”, “MakeNonSolid”, MakeNonSolid)[/lua]
Try that. You were making the prop collide with nothing when you freeze it. I made it so it saves the old collission group and then set it back to when it was before when you freeze it.

[editline]16th December 2013[/editline]

Also what vexx said

Okay. Thanks.