Dealing damage and taking damage with sword

Hello i am making a simple multiplayer hack in slash game how would i set it up to deal damage with sword and also how would i take damage from other players. Thanks i am new to this genre only done simple racing games before