Hello, so basically a weld called ‘RightGrip’ keeps on messing up my tool animation. When I attempt to remove it through a script, it produced this warning:
The Script:
for i, weld in pairs(script.Parent:GetDescendants()) do
if weld:IsA("Weld") and weld.Name == "RightGrip" then
weld:Destroy()
end
end
script.Parent.DescendantAdded:Connect(function(Unwelcomeone)
if Unwelcomeone:IsA("Weld") and Unwelcomeone.Name == "RightGrip" then
Unwelcomeone:Destroy()
end
end)
script.Parent.DescendantAdded:Connect(function(Unwelcomeone)
if Unwelcomeone:IsA("Weld") and Unwelcomeone.Name == "RightGrip" then
task.wait()
Unwelcomeone:Destroy()
end
end)
local Game = game
local Players = Game:GetService("Players")
local Debris = Game:GetService("Debris")
local function OnPlayerAdded(Player)
local function OnCharacterAdded(Character)
local Humanoid = Character:FindFirstChildOfClass("Humanoid") or Character:WaitForChild("Humanoid", 10)
if not Humanoid then return end
local RigType = Humanoid.RigType.Name
local RightLimb = if RigType == "R6" then Character:FindFirstChild("Right Arm") or Character:WaitForChild("Right Arm", 10) elseif RigType == "R15" then Character:FindFirstChild("RightHand") or Character:WaitForChild("RightHand", 10) else nil
if not RightLimb then return end
local function OnRightLimbChildAdded(Child)
if Child.Name ~= "RightGrip" then return end
Debris:AddItem(Child, 0)
end
RightLimb.ChildAdded:Connect(OnRightLimbChildAdded)
for _, Child in ipairs(RightLimb:GetChildren()) do
OnRightLimbChildAdded(Child)
end
end
Players.CharacterAdded:Connect(OnCharacterAdded)
end
Players.PlayerAdded:Connect(OnPlayerAdded)