This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts.
Player function creates a new character for the player, removing the old one. It also clears the player’s
This is useful in cases where you want to reload the character without killing the player, such as when you want to load a new character appearance after changing the player’s
The function is similar to
Player/LoadCharacterBlocking, but the request is processed asynchronously instead of synchronously. This means other tasks will be able to continue while the character is being loaded, including the rendering of the game and any other tasks. Also, this function can be used in script, while LoadCharacterBlocking cannot.
How to Turn of Auto-Loading and Simulate Character Respawn
This script turns off auto-loading and simulates character respawning.
local respawnDelay = 5 game.Players.CharacterAutoLoads = false game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) -- find the humanoid, and detect when it dies local humanoid = character:FindFirstChild("Humanoid") if humanoid then humanoid.Died:Connect(function() wait(respawnDelay) player:LoadCharacter() end) end end) player:LoadCharacter() -- load the character for the first time end)