Hello. I have this spectate script and I'm trying to fix a certain part of this script where the camera doesn't focus back on the player after they die and respawn. The problem is I can't seem to make CharacterAdded work.
Here's the part of the script:
playerList[position].CharacterAdded:Connect(function(char)
--repeat
print("test")
updateCamera(playerList[position])
--until char.Humanoid.Health ~= 0
end)
I already tried fixing it by creating a name string for the player but it still didn't work.
It looked something like this:
local playerName = playerList[position].Name
game.Players.playerName.CharacterAdded:Connect(function(char)
--repeat
print("test")
updateCamera(playerList[position])
--until char.Humanoid.Health ~= 0
end)

1 comment
Use RemoteEvents.