I have been searching for a way to make it so that when players are in the lobby they can't kill each other (disable team kill) but when they get teleported to the map and are placed on the Survival team they can kill each other even though they are still on the same team. I have found bits of script in guides and stuff that allow you to disable team killing overall but not for only one specific team (the lobby team) Also I can't script it into my individual weapons because of the way they are set up so I help finding a way to do this under one script in ServerScriptService or Workspace.

I found this script in a guide but it is for inside the weapon and disables teamkill overall. I need it to be in workspace or Serverscriptservice and for only the Lobby team. If anyone could help that would be great!

local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Player.TeamColor ~= vPlayer.TeamColor then 
    tagHumanoid(humanoid, vPlayer)
    humanoid:TakeDamage(damage)
    wait(1)
    untagHumanoid(humanoid)
end