Help with nocolide

Hi all.
I am doing lua script for my gamemode.
Help with nocolide players,i have lua script ,he is work,but bad (lags when 1 player touch 2 player).
Code:
function ShouldCollideHook( ply )

if ( ply:IsPlayer() and ply:IsPlayer() ) then
	return false 
end 

end
hook.Add( “ShouldCollide”, “ShouldCollideHook”, ShouldCollideHook )

I’m pretty sure that hook has been broken for a while, I tried to use it about a month ago with no results.

How then can I do nocolide players?

**[Gamemode.ShouldCollide

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.ShouldCollide)** has 2 arguments, Entity 1 and Entity 2. You are returning false if the first entity is a player and if the first entity is a player.

same

Your example nocollides the player with everything, you should add a second argument and change one ply:IsPlayer() to that argument name, like maybe ply2.

if (ply:IsPlayer() && ply2:IsPlayer()) then return false end

I still think the hook is broken.

It’s not broken, if you are referring to that props are sometimes bouncing up and down when using this hook, then thats caused by returning two different states (true/false) for the same entities. It’s a known issue.

However if you are saying that the hook isn’t even called, then you’re doing something wrong. (*Keep in mind that some gamemodes overrides this hook directly and returns true on everything *)

I’m just telling you, I think I would know if it was being called or not. The last time I tried to use this it was not even being called, I tried printing the arguments, nothing.

As I said, some gamemodes override this completely by doing (I might be wrong in what priority the hooks are to the gamemode table, unsure)
[lua]
function GM:ShouldCollide(ent1, ent2)
return true
end
[/lua]

I overwrote it in my gamemode, it didn’t do shit. I’m going to go try it again.

Fuck me, it does get called, I dunno why it didn’t work last time.

It is not called at the actual collision but rather at the intersection of the objects’ bounding boxes

[editline]11th March 2011[/editline]

Kinda