Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ConvertPlayerCharacterToRig #445

Merged
merged 1 commit into from
Jul 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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