Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

LoadCharacter does not use StarterCharacter?

I am making a GUI that changes the players' character based on which skin they've chosen. I'm still testing the system, but it seems to not work. When I call player.LoadCharacter() the character reloads to the old one. I've messed around with it and, sure enough, the StarterCharacter is changed. Can someone tell me what I'm doing wrong? I changed the character from a LocalScript. Here's my code:

---Local script------

wait(10)
game:GetService("StarterPlayer").StarterCharacter:Destroy()
game:GetService("ReplicatedStorage").StarterCharacter:Clone().Parent=game:GetService("StarterPlayer")
wait(20)
game:GetService("ReplicatedStorage").RemoteEvent:FireServer(game:GetService("Players").LocalPlayer.Name) 

-----Server script----

game:GetService("ReplicatedStorage").RemoteEvent.OnServerEvent:Connect(function(p)
	local char = game:GetService("Players"):FindFirstChild(p.Name):LoadCharacter()
end)

1 comment

0

Same thing happens with loading character after using Player.CharacterAppearanceId

1 answer

If you haven't already, disable CharacterAutoLoads.

You also want to just load the custom character without deleting the default one, setting that to player.Character, and then parenting the new character in workspace.

You don't need to use remote events at all by the look of it.

1 comment

0

CharacterAutoLoads does not fix the problem. As far as using player.Character, it's a bad way to do this. I would have to change the camera and when the player resets or dies, the respawn breaks. A remote event is needed as you cannot call LoadCharacter() from inside a LocalScript to my understanding.

This discussion is preserved as it was. New answers, comments, and votes are closed.