Why does my character switch back to the default character after I change it to a custom one with a script?

Local script in StarterCharacterScripts

local Player = game.Players.LocalPlayer
local Character = Player.Character

wait(2)

Player.Character = game.Workspace.Dragon
Character.Parent:Destroy()

This changes my character to the dragon for a few seconds, but then I automatically respawn as my default character and the dragon is destroyed.

I’ve tried this in a server script as well.

Character.Parent:Destroy()

You are destroying the character’s parent with character itself. That’s why you respawn.

Oh lol, I don’t know how I missed that.

1 Like

Didn’t fix the issue unfortunately, character still respawns as default after a few seconds.

1 Like

Copy “Dragon”, put it in StarterPlayer and rename it to “StarterCharacter”, you may remove the script and it should automatically make the player spawn with this.

I don’t want everyone to spawn as the dragon, I just want one person to turn into the dragon mid-game. This script is just a test script.

So your script is a LocalScript meaning that only the player will see themself as the Dragon.
On the server you’d have to use Player.CharacterAdded and change the player’s character to the dragon everytime they spawn.

I don’t think this is the problem because I tried it in a server script as well and had the same issue.

Put the Script in StarterPlayerScripts

I tried this and it actually worked, thanks!

More Info:

The StarterCharacterScripts class stores scripts to be parented in a player’s Character, when they spawn.
Unlike scripts stored in the PlayerScripts folder, these scripts will not persist when the player respawns.

2 Likes