local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Events = ReplicatedStorage.Events

Events.JoinTeam.OnServerEvent:Connect(function(player, team)
    local IsTeam
    if team == game.Team.Name then
        IsTeam = true
    else
        IsTeam = false
    end
    
    if IsTeam then
        player.Team = Team
        if not ReplicatedStorage.MatchData.InTeams then
            Events.KillMe:FireServer()
            Events.LoadCharacter:FireServer()
        end
    end
    
    return tostring(team)
end

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: