Hi, I have CharacterAutoLoads disabled in my game because I have a main menu and don’t want to spawn the player right when they join, but rather when they click play in the main menu, this works, but if the player resets or dies, they do not respawn, how can I rectify this?
4 Likes
When you spawn a player, connect a function to humanoid.Died. Handle respawning in that function, and then reconnect humanoid.Died everytime you respawn.
You can use the :LoadCharacter() to spawn the player’s character.
EXAMPLE: game.Players.lV0rd:LoadCharacter()
And as @thebigkannye mentioned, you can detect a player dying using the .Died event on the humanoid for example:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character.Humanoid.Died:Connect(function()
player:LoadCharacter()
end)
end)
end)
2 Likes
btw you can add a task.wait(how long in seconds) before the loadcharacter() line
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.