Let's say i have 2 separate teams. I want players on team A to collide with a certain object, but players on team B can walk through it.
Is this possible? I tried making team A use COLLISION_GROUP_PLAYER, the object uses COLLISION_GROUP_WEAPON and team B uses COLLISION_GROUP_INTERACTIVE but this gives strange results. The prop bounces team B instead of acting like a solid.
Hi, my name is Seagull, and I'll be your Guide today.
We are going to be working with the [B]Shared[/B] side of things today and the hook [I]ShouldCollide[/I].
[lua]
hook.Add( "ShouldCollide", "DontCollidePls", function( ply, ent ) --Calls the hook and our variables
if ( ply:Team() == 2 && ent:ARGS() ) then
return false
end
return true
end )
[/lua]
You're going to want something along the lines of that. You'll want to change the ARGS section to whatever best fits the entity you don't want to collide.
Hope I helped :)
If you have any problems or questions, feel free to PM me here on Facepunch!
i've used ShouldCollide before but it seemed really expensive and wonky. I'll fuck with it some more i guess.
[QUOTE=MrGregsWorld;40796707][lua]
hook.Add( "ShouldCollide", "DontCollidePls", function( ply, ent ) --Calls the hook and our variables
if ( ply:Team() == 2 && ent:ARGS() ) then
return false
end
return true
end )
[/lua][/QUOTE]
Why return true? You'll most likely fuck up a lot of shit that uses this hook.
[QUOTE=Ice Tea;40797405]Why return true? You'll most likely fuck up a lot of shit that uses this hook.[/QUOTE]
I see what you mean, but it was not specified in his OP about other functions that call it. Besides, it was meant more as a basis to observe, rather than a Copy/Paste :)
Sorry, you need to Log In to post a reply to this thread.