Teams in sandbox?

Is there a way to play basically the normal sandbox gamemode, but with one change so that certain players can’t damage eachother.
EX: 4 players (A,B,C,D) playing normal sandbox mode. A & B can’t damage each other, and C & D can’t damage eachother. Everyone else can damage each other normally.
Whether this is an existing gamemode or addon, I don’t know. I am just wondering.

I don’t believe it exists currently, but it would be easy to just add an

GM:EntityTakeDamage hook and check for teams there.

i use to have a script similar to this, dont have it anymore but you can build on this



hook.Add("ShowSpare1","ChangeSandboxTeam",function(ply)
ply:SetNWBool("SandboxMode",!ply:GetNWBool("SandboxMode"))
end)
hook.Add("EntityTakeDamage","RefuseSandboxDamage",function(target,damageinfo)
  if ( target:IsVehicle() ) then
    local ply = target:GetDriver()
    if (IsValid(ply) && ply:GetNWBool("SandboxMode")==true) then
      damageinfo:SetDamage(0)
      return
    end
end
if (IsValid(target) && target:GetNWBool("SandboxMode")==true) then
  damageinfo:SetDamage(0)
  return
end

end)


not tested so :stuck_out_tongue: