[DarkRP] Disabling Player to PLayer Collisions?

Hey! This is my second post on FacePunch!

Anyways, as you can tell from the title, I’m trying to figure out how to disable all player collisions with other players. duuh :stuck_out_tongue:

This is important because I’ve added the Aperture Science Portal Gun Addon to my server, and when two players enter the portal. They get stuck on the other side :confused:

I’m having trouble finding out how I’d approch fixing this. Hopefully someone out there might know & is willing to share their knolage! :smiley:

put all players to the same team

Alright, How do you make a team?

Putting everyone on the same team will ruin the jobs. Just put this in your lua/autorun/server:



hook.Add("ShouldCollide","NCPlayers",function(a,b)
if a:IsPlayer() and b:IsPlayer() then
return false 
end 
end)


[sp](The jobs part is assuming you’re on darkrp)[/sp]

Also, please don’t get mad at me if the Portal Gun causes more problems in a DarkRP server than it’s worth :frown:. It’s designed for singleplayer sandbox.

Hell no.

Tested this and sadly it doesn’t work :c

you do realize jobs are teams right

you also need to do this in a serverside file:

[lua]
hook.Add(“PlayerInitialSpawn”,“NoCollide Players”, function(ply)
ply:SetCustomCollisionCheck(true)
end)
[/lua]

Is this what you mean?

Save the fallowing code as example.lua in lua/autorun/server

[lua]
hook.Add(“ShouldCollide”,“NCPlayers”,function(a,b)
if a:IsPlayer() and b:IsPlayer() then
return false
end
end)

hook.Add(“PlayerInitialSpawn”,“NoCollide Players”, function(ply)
ply:SetCustomCollisionCheck(true)
end)
[/lua]

Pls don’t whip me if I’m wrong haha

No that’s right.

Tested the following code.

[lua]
hook.Add(“ShouldCollide”,“NCPlayers”,function(a,b)
if a:IsPlayer() and b:IsPlayer() then
return false
end
end)

hook.Add(“PlayerInitialSpawn”,“NoCollide Players”, function(ply)
ply:SetCustomCollisionCheck(true)
end)
[/lua]

Does what is entended but m9k bullets pass though players giving no damage & it is impossible to target players. So, I cannot pick them up.

Pretty strange. Maybe try setting the players’ collision groups to COLLISION_GROUP_INTERACTIVE_DEBRIS

I sound dumb, but how exactly do I change the collision group? derp

[lua]
hook.Add(“PlayerInitialSpawn”,“NoCollide Players”, function(ply)
ply:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE_DEBRIS)
end)
[/lua]

Tested, doesn’t work. players collide with each other.

Try with COLLISION_GROUP_WEAPON

COLLISION_GROUP_WEAPON collides with other COLLISION_GROUP_WEAPON though.

Nah, didn’t work. same resualt as.
[lua]
hook.Add(“PlayerInitialSpawn”,“NoCollide Players”, function(ply)
ply:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE_DEBRIS)
end)
[/lua]