game.Players.PlayerAdded:Connect(function(Player)
local Char = Player.Character or Player.CharacterAdded:Wait()
wait(3)
Char:WaitForChild("Humanoid").Health = 0
end)
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
Character:WaitForChild("Humanoid").Health = 0
end)
end)
This is basically the same code
I need the player to die so that they respawn as my custom character script
and yes I have tried manually setting the custom character when they join the game
and it still does the same thing
I have tried to do LoadCharacter everything
The code does run but it does not kill the player
I have also tried
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
Character:SetPrimaryPartCFrame(CFrame.new(0,99999,0))
end)
end)
To see if my code was working but from what I see
Anything relating to the character does not work with characterAdded
when they first join in the game
you need to place a wait
does anyone know a solution to this that does not require something along the lines of doing
wait(5)
Cause this is completely unreliable

1 comment
Killing the player when they spawn seems like a bandaid fix. Try setting Players.CharacterAutoLoads to false and Player:LoadCharacter().