PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

LoadCharacter

The LoadCharacter Player function creates a new character for the player, removing the old one. It also clears the player’s Backpack and PlayerGui.

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 Player.CharacterAppearance.

Note

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.

Returns

Return Type Summary

No return.


Code Samples


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)