im making an animation game like the unknown meme animation game, and i made this script along with some other ones but in this one, if i enter a r6 rig i tried to make it r15, and it didnt spawn with clothes, and it clipped through the ground, so i put humanoiddescription stuff and it still doesnt work, and the r6 converted into r15 rig spawns a little higher but when it comes down it clips into the ground. am i doing something wrong
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UpdateRigEvent = ReplicatedStorage:WaitForChild("UpdateRig")
local function convertToR15(character)
if character and character:IsA("Model") then
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.RigType = Enum.HumanoidRigType.R15
local humanoidDescription = humanoid:FindFirstChildOfClass("HumanoidDescription")
if humanoidDescription then
humanoid:ApplyDescription(humanoidDescription)
end
end
end
end
local function updateRig(username)
local player = Players:GetUserIdFromNameAsync(username)
if player then
local character = Players:CreateHumanoidModelFromUserId(player)
if character then
local rig = workspace:FindFirstChild("Rig")
local rigPosition = rig and rig:GetPivot() or CFrame.new(0, 0, 0)
if rig then
rig:Destroy()
end
character.Name = "Rig"
character.Parent = workspace
character:PivotTo(rigPosition)
convertToR15(character)
-- Adjust the position to ensure it's not stuck in the ground
local rootPart = character:FindFirstChild("HumanoidRootPart")
if rootPart then
rootPart.CFrame = rigPosition + Vector3.new(0, 5, 0) -- Adjust the Y offset as needed
end
end
end
end
UpdateRigEvent.OnServerEvent:Connect(function(player, username)
updateRig(username)
end)