-- / Functions / --

EventModule.ActivateEvent = function()
	
	local RandomPlayer1 = PlayingTeam:GetPlayers()[math.random(1, #PlayingTeam:GetPlayers())]
	local Character1 = RandomPlayer1.Character or RandomPlayer1.CharacterAdded:Wait()
	local Humanoid1 = Character1:WaitForChild("Humanoid")
	
	local HumanoidDescription1 = game.Players:GetHumanoidDescriptionFromUserId(RandomPlayer1.UserId)	
	
	local RandomPlayer2
	
	if #PlayingTeam:GetPlayers() > GameConfiguration.MinPlayerAmount.Value then
		repeat 
			task.wait()

			RandomPlayer2 = PlayingTeam:GetPlayers()[math.random(1, #PlayingTeam:GetPlayers())]
		until 

		RandomPlayer2.Name ~= RandomPlayer1.Name

		local Character2 = RandomPlayer2.Character or RandomPlayer2.CharacterAdded:Wait()
		local Humanoid2 = Character2:WaitForChild("Humanoid")

		local HumanoidDescription2 = game.Players:GetHumanoidDescriptionFromUserId(RandomPlayer2.UserId)

		for _, Accessory in pairs(Character1:GetChildren()) do
			if Accessory:IsA("Accessory") then
				Accessory:Destroy()

			end
		end

		for _, Accessory in pairs(Character2:GetChildren()) do
			if Accessory:IsA("Accessory") then
				Accessory:Destroy()

			end
		end

		Humanoid1:ApplyDescription(HumanoidDescription2)
		Humanoid2:ApplyDescription(HumanoidDescription1)

		RandomPlayer1.Team = PlayingTeam
		RandomPlayer2.Team = PlayingTeam
	end
end
