I’ve recently made an idle animation and I’m trying to play it on the player’s cloned character
local RS = game:GetService("ReplicatedStorage")
local Tween = game:GetService("TweenService")
local Stance = RS:WaitForChild("Stance")
local FStance = Stance:WaitForChild("FireStance")
FStance.OnServerEvent:Connect(function(player, status)
local character = game.Workspace:WaitForChild(player.Name) or player.Character or player.CharacterAdded:Wait()
character.Archivable = true
print(player.Name)
if status == "Equipped" then
task.wait(0.1)
local PlayerStance = character:Clone()
local AnimLoader = Stance.AnimController:Clone()
PlayerStance.Name = "PlayerStance"
AnimLoader.Parent = PlayerStance
local PlayerStanceHumanoid = PlayerStance:FindFirstChild("Humanoid")
local PlayIdle = PlayerStanceHumanoid:LoadAnimation(AnimLoader.Idle)
PlayIdle:Play()
for _, v in pairs(PlayerStance:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("Part") then
if v.Name ~= "HumanoidRootPart" then
v.Transparency = 1
local TweeningInfo = Tween:Create(v, TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {Transparency = 0.66})
TweeningInfo:Play()
end
end
end
PlayerStance.Parent = character
PlayerStance.Animate:Destroy()
PlayerStanceHumanoid.HumanoidDescription:Destroy()
PlayerStanceHumanoid.Animator:Destroy()
PlayerStanceHumanoid.DisplayDistanceType = "None"
PlayerStance["Head"].face:Destroy()
PlayerStance["Right Leg"]:Destroy()
PlayerStance["Left Leg"]:Destroy()
for _, v in pairs(PlayerStance:GetChildren()) do
if v:IsA("BasePart") or v:IsA("Handle") or v:IsA("Part") then
v.CanCollide = false
end
end
local welding = Instance.new("Weld", PlayerStance)
welding.Name = "Welding"
welding.Part0 = character.HumanoidRootPart
welding.Part1 = PlayerStance.HumanoidRootPart
welding.C1 = CFrame.new(0, 0, 0)
local TweeningInfo = Tween:Create(welding, TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {C1 = CFrame.new(2.7, -1.1, -2)})
TweeningInfo:Play()
elseif status == "Unequipped" then
local PlayerStance = character:FindFirstChild("PlayerStance")
local welding = PlayerStance:FindFirstChild("Welding")
for _, v in pairs(PlayerStance:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("Part")then
if v.Name ~= "HumanoidRootPart" then
local TweeningInfo = Tween:Create(v, TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {Transparency = 1})
TweeningInfo:Play()
local TweeningInfo = Tween:Create(welding, TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0), {C1 = CFrame.new(0, 0, 0)})
TweeningInfo:Play()
end
end
end
wait(2)
PlayerStance:Destroy()
end
end)
but whenever I test the script, I get this error,
Any feedback on how to fix this issue would be appreciated, I was stuck on this issue for 2 hours and I’ve looked on the dev forum for solutions but I still had the same error…

