Problems changing the player character

Hello guys! I’m doing a game, that you can select classes to battle, and all classes have unique characters, but when I click the select button, I become the normal roblox rig, instead of the correct character.

(Ignore the music lol)

The explorer:

The pizza character:

My script:

script.Parent.ServerRemote.OnServerEvent:Connect(function(plr)
	local plrC = plr.Character or plr.CharacterAdded:Wait()
	local morph = game.ReplicatedStorage.Characters:FindFirstChild(script.Parent.MorphName.Value)
	
	local ph: Humanoid = plrC:WaitForChild("Humanoid", 8)
	if not ph then return end
	
	local mh: Humanoid = morph:WaitForChild("Humanoid", 8)
	if not mh then return end
	
	local desc = mh:GetAppliedDescription()
	
	ph:ApplyDescription(desc)
	
	plr.PlayerGui.SelectClassGUI.ScrollingFrame.Visible = false
end)

Something wrong with the script?

And yes, the remote event works perfectly.

this is a shot in the dark, but have you tried replacing :WaitForChild with :FindFirstChild?

like this?

local ph: Humanoid = plrC:FindFirstChild("Humanoid", 8)
if not ph then return end
	
local mh: Humanoid = morph:FindFirstChild("Humanoid", 8)
if not mh then return end

Edit: I tried but it’s still making me a normal rig

more like this:

script.Parent.ServerRemote.OnServerEvent:Connect(function(plr)
	local plrC = plr.Character or plr.CharacterAdded:Wait()
	local morph = game.ReplicatedStorage.Characters:FindFirstChild(script.Parent.MorphName.Value)
	local ph: Humanoid = plrC:FindFirstChild("Humanoid")
	local mh: Humanoid = morph:FindFirstChild("Humanoid")
	local desc = mh:GetAppliedDescription()
	
	ph:ApplyDescription(desc)
	
	plr.PlayerGui.SelectClassGUI.ScrollingFrame.Visible = false
end)

Still nothing, It seems like roblox thinks there’s no acessories in the Pizza model.

Perhaps. could you provide an image of the children of the Pizza model?

I guess I found the problem right now, It seems the HumanoidDescription of the Pizza’s humanoid not updated.

And yeah here the image:

Do there’s a way to update the humanoidDescription?

1 Like

I updated the HumanoidDescription manually, and it worked, probably roblox didn’t add a function to update the HumanoidDescription yet.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.