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)
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.