Hello, I want to make a character shop, but I do not know how to make one. I mainly don’t know how to change the character for players who bought the skin. I would like some examples, or tutorials. Thank you.
I think you change the “Player.Character” property to the character model you just bought, then you reload the character using Player:LoadCharacter() and cframe him back to his previous cframe.
Player.Character = KnightModel
Would be easier to help if you provide any examples (image, gif or video).
I already have a Rigged StarterCharacter inside the StarterPlayers folder, so player’s won’t join with their normal roblox avatar. Also, like you mentioned, if you do Player.Character = KnightModel, will the player get the character of “KnightModel” with every animations? Thanks.
Also, isn’t Player:LoadCharacter() only for loading someone’s UserId? Like Player:LoadCharacter(“Player’s UserId”). Sorry, I didn’t use these script words before.
I think if it haves all the animations inside a script it will load the animations. I just tested Player.Character = [model]
and you will have to fix the camera and remove the other character
Player:LoadCharacter() works as respawning the character.
You will need to run at server.
Do I need to put the model of the character in Workspace or ServerStorage?
now my camera is fixed, you will have to remove the old character.
i think it does not care, but you will have to clone the new character model because it will replace the player character with the new character model.
ServerStorage is only accessible for ServerScripts. But any script can access to Workspace. As long as LocalScript cannot bypass themselves to the character, any way is ok!
I scripted this, but it doesn’t work. Do you see any problem with the script? The output has one error saying "Character is not valid member of Players “Players”.
local character = game.Workspace.Dummy
local button = script.Parent
local player = game:GetService("Players")
function clicked()
player.Character = character
end
button.MouseButton1Click:Connect(clicked)
player is a service…?? I think you meant for yourself not the service. You can get the player parameter using PlayerAdded event.
My problem is that the player won’t have the character when the player clicked on the TextButton.
There is a way to switch characters. Here’s a fairly simple tutorial:
Did you change your script? But the issue is Players service is not a real player, it’s a service, and it does not have a children called Character inside, therefore it’s indexing nothing, instead, if it’s a real player, indexing the character will return the character in Workspace.
Wait it’s unclear to me, if your struggling to make the GUI elements and the how to make shop system work or you just can’t change a players avatar…
I changed my script to
local character = game.Workspace.Dummy
local button = script.Parent
local player = game.Players.LocalPlayer
function clicked()
player.Character = character
end
button.MouseButton1Click:Connect(clicked)
I already have the shop gui, and the gui elements, but I don’t know how to change the player’s character to the character that the player bought.
I tried this before, but this isn’t what I want.
Changing the players character is actually kinda a little trickier said than done…
Have a look here, you must actually rig the player properly, just saying so it doesn’t cause future issues with compatibility between different rigs…