Hello! im making it so that when the player defeats the other player, the players get teleported back for another round of fighting.
However, this isn’t working as only one player gets teleported back. This one player is the one that defeated the other player.
The player who got defeated, died, and didn’t teleport when respawned.
There are no errors in the output. Can someone help me? I would greatly appreciate it.
Thank you.
game.ReplicatedStorage.CountdownFight:FireClient(game.Players:FindFirstChild(Player1.Value))
game.ReplicatedStorage.CountdownFight:FireClient(game.Players:FindFirstChild(Player2.Value))
game.Players:FindFirstChild(Player1.Value).Character.Humanoid.Died:Connect(function()
player1death += 1
print('player 1 death and player 2 won')
game.Players:FindFirstChild(Player1.Value).CharacterAdded:Connect(function(char)
print('player 1 character added')
--tp players for another round
local Character1 = char
local HumanoidRootPart1 = Character1:FindFirstChild("HumanoidRootPart") or Character1:WaitForChild("HumanoidRootPart")
local Character2 = game.Players:FindFirstChild(Player2.Value).Character
local HumanoidRootPart2 = Character2:FindFirstChild("HumanoidRootPart") or Character2:WaitForChild("HumanoidRootPart")
print('gotten all characters and humanoidrootparts')
print('humanoid root part 1')
HumanoidRootPart1.CFrame = Spawnpoints.Player1.CFrame
print('teleported player 1')
roundnum += 1
print(roundnum)
print('humanoid root part 2')
HumanoidRootPart2.CFrame = Spawnpoints.Player2.CFrame
print('teleported player 2')
roundnum += 1
print(roundnum)
end)
end)