I know how you would usually do this but how would you do it in a script? Meaning changing the players character after clicking a button.
what do you mean by changing the character? changing the appearance? changing to controlling a different character model? Be more specific
I want to change the players skin.
you can use InsertService:LoadAsset(assetId)
to load a specific item from the catalog, then use Humanoid:AddAccessory(accessory)
to add the accessory to the player, to change body colors you can change the properties of Character.BodyColors
You should try using StarterCharacter
under StarterPlayer
. However, if you’re opting in for multiple different rigs and characters, there should be a custom character loading logic along with it to set a character for the player through Player.Character
, followed by parenting or LoadCharacter
function, not sure which one, but try them both.
I think (not too sure) that you can just do player.Character = model? Im probably wrong tho.
I tried that but it didn’t work.
I’ll try that.
It looks like you want to try a different method that involves morphing, if I reckon that correctly. Traditionally, they “manipulate” the character by adding, removing or changing body parts. However, I don’t think changing does work in certain cases, like the R15.
You could opt for a menu to select a morph that changes the character before spawning.
Yes that is what I am trying to do if I was not clear with that then I am sorry.
It did not work. Is there anything else at all?
I did this by cloning the character I wanted the player’s character to be, then in a script I basically did,
local newCharacter = myNewCharacter -- use the character you want
local newcharacterClone = newCharacter:Clone()
player.Character = newCharacterClone
It did not work. There were also no errors.
My code
local RemoteEvent = game.ReplicatedStorage.RemoteEvent
game.Players.CharacterAutoLoads = false
game.Players.PlayerAdded:Connect(function(player)
RemoteEvent.OnServerEvent:Connect(function()
local newCharacter = game.ReplicatedStorage.StarterCharacter
local newcharacterClone = newCharacter:Clone()
player.Character = newcharacterClone
player:LoadCharacter()
end)
end)
Don’t load the player, doing so will reset the player to their default character
Oh, ok. How else would I do it though?
You can remove that line and it should do the trick.
After I deleted the line of code the player won’t load in.
you need to parent the character clone to the worlspace.
Still didn’t work. I know there is a way because people have done this before.