-- Gamemode: Tag-- Hitting players makes them join your team.-- Once everyone is on the same team the game ends.Events.EntityDamage(function(event)-- Can only tag playersifnot event.entity:getPlayer() thenreturnend-- Make sure the tagger is a playerif (not event.fromEntity ornot event.fromEntity:getPlayer()) thenreturnendlocal attackerTeam = TeamService.getTeam(event.fromEntity:getPlayer()) TeamService.setTeam(event.entity:getPlayer(), attackerTeam)-- Check that all teams besides the attackerTeam are empty-- If so give win to attacker teamlocal gameOver =truefor i, team inipairs(TeamService.getAllTeams()) doif (team == attackerTeam) then continueend-- If another team has players the game is not overif#team:getInGamePlayers() >0then gameOver =falsebreakendend-- Give out winif gameOver then MatchService.endMatch(attackerTeam)endend)