How to make it so other players can't damage eachother

I’m making an event-based game.

One of the events is based on SFOTH, and it gives everyone the classic sword gear and allows people to attack each other. Another one is a zombie event.

During the zombie event, I want people to be given the same sword but have it have no functionality to kill other players.

Is there a way to do this, specifically with the classic sword gear?

EDIT: I don’t mean actual gear, I mean like the one in the toolbox

During the event where you don’t want players to damage each other, just check if the target player is an actual player, if it is don’t deal damage if it’s not you know it’s an NPC. Alternatively, you can tag each player with a ‘DontDamage’ tag and in the function to deal damage, check if the target has that tag, if so, don’t damage.

I actually figured it out
I tagged each zombie with a value and in the sword script checked if the hit object had this value. If it did, hooray! if not, nothing else happened.