Skip to content

Commit

Permalink
Merge pull request #445 from evanultra01/patch-3
Browse files Browse the repository at this point in the history
Fix ConvertPlayerCharacterToRig
  • Loading branch information
Sceleratis authored Jul 30, 2021
2 parents 621c841 + 0e27ffa commit 7a70ea6
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions MainModule/Server/Core/Functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7a70ea6

Please sign in to comment.