LoadCharacter creates a new character for the player, removing the old one. It also clears the player's Backpack and PlayerGui.
void LoadCharacter ( bool inGame = true )
Defaults to: true
- This item should be used in a Script to work as expected online.
- If InGame is false, this will block the main thread when loading the character appearance. Do not set this parameter to false or you will experience bad performance.
- If the Players's Character is using R15, this function will yield until all of the player's CharacterAppearance assets have loaded.
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)