So, currently, I have
[CODE]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)[/CODE]
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
[QUOTE=highvoltage;43206666][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[/QUOTE]
Okay. Thanks.
Sorry, you need to Log In to post a reply to this thread.