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