Prop No colide everything except player?

Pretty much says it in the title I am having problems with having a prop noclide everything except a player I just cannot figure it out.

[lua]Entity:SetCollisionGroup( COLLISION_GROUP_VEHICLE_CLIP )[/lua]

This makes it no clip the entire world but the player also. I would like this to be able to fly through the world, props, entities, and only hit a player how would I go about doing this?

Not sure if I can make a ply is player command or not or how I would for this one.

Try Entity:SetCollisionGroup( COLLISION_GROUP_WEAPON )
I know it doesn’t collide with players, but I’m not sure if it collides with everything else. Worth a try though.

It does I have tried it already. I want the prop to fly through everything But a player, So the prop hits the player. I’m sure it can be done I just have no clue how.

You have to use something special for this. Be careful to not change the results of the callback without calling CollisionRulesChanged or you will crash vphysics.

entity/shared.lua
[lua]
function ENT:ShouldNotCollide(ent)
if ent:IsValid() and ent:IsPlayer() then
return false
end

return true

end[/lua]

entity/init.lua
[lua]
function ENT:Initialize()
self:SetCustomCollisionCheck(true)
self:CollisionRulesChanged()
[/lua]

gamemode/shared.lua
[lua]
function GM:ShouldCollide(enta, entb)
if enta.ShouldNotCollide and enta:ShouldNotCollide(entb) or entb.ShouldNotCollide and entb:ShouldNotCollide(enta) then
return false
end

return true

end

local meta = FindMetaTable(“Entity”)
if not meta then return end

function meta:CollisionRulesChanged()
if not self.m_OldCollisionGroup then self.m_OldCollisionGroup = self:GetCollisionGroup() end
self:SetCollisionGroup(self.m_OldCollisionGroup == COLLISION_GROUP_DEBRIS and COLLISION_GROUP_WORLD or COLLISION_GROUP_DEBRIS)
self:SetCollisionGroup(self.m_OldCollisionGroup)
self.m_OldCollisionGroup = nil
end
[/lua]

Okay thank you I will try this Now with this said the entitie that I have made is called “train” would I have to change most of the “ent” in these scripts or would it just be

[lua]
local meta = FindMetaTable(“Entity”)[/lua]

I really appreciate all the help this was a little over my head on this one.