From 0e27ffad9c36dde0f3aa5391f84fb0ced04969c2 Mon Sep 17 00:00:00 2001 From: evanultra01 <63222884+evanultra01@users.noreply.github.com> Date: Fri, 30 Jul 2021 15:38:06 -0400 Subject: [PATCH] Fix ConvertPlayerCharacterToRig why does waitforchildofclass not exist anymore --- MainModule/Server/Core/Functions.lua | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/MainModule/Server/Core/Functions.lua b/MainModule/Server/Core/Functions.lua index b9497318da..d5263ba1ae 100644 --- a/MainModule/Server/Core/Functions.lua +++ b/MainModule/Server/Core/Functions.lua @@ -1009,15 +1009,19 @@ return function(Vargs) end end; - ConvertPlayerCharacterToRig = function(p, rigType) + ConvertPlayerCharacterToRig = function(plr, rigType) local rigType2 = rigType or Enum.HumanoidRigType.R15 - local humd = p.Character:WaitForChildOfClass("Humanoid"):GetAppliedDescription() or service.Players:GetHumanoidDescriptionFromUserId(userId) - local model = service.Players:CreateHumanoidModelFromDescription(humd, rigType2) - model.Parent = p.Character.Parent - local old = p.Character:WaitForChild("HumanoidRootPart").CFrame - p.Character:Destroy() - model:WaitForChild("HumanoidRootPart").CFrame=old - p.Character=model + local humd = plr.Character:WaitForChild("Humanoid"):GetAppliedDescription() or service.Players:GetHumanoidDescriptionFromUserId(userId) -- why is waitforchildofclass not a thing anymore :( + local model = game:GetService('Players'):CreateHumanoidModelFromDescription(humd,rigType2) --This code is basically PlrGear (:dollify) without the resizing and tool parts because it didnt work previously for some reason. Probably because of some internal roblox spaghetti. + model.Name=plr.DisplayName + local oldcframe = plr.Character:FindFirstChild("HumanoidRootPart").CFrame + local oldparent = plr.Character.Parent + plr.Character:Destroy() + plr.Character=model + model:SetPrimaryPartCFrame(oldcframe) + local cfr = (plr.Character:FindFirstChild('HumanoidRootPart')).CFrame + model.Parent = oldparent + model:SetPrimaryPartCFrame(cfr) return model end;