Hello! I’m just now starting to learn on how to use welds. In the video I’m trying to move while the boxing gloves are equipped and it won’t let me. I want the player to move while sticking to the player’s hands.
Code:
local RunService = game:GetService("RunService")
local Player = game:GetService("Players").LocalPlayer
RunService.Heartbeat:Connect(function()
local Player = game:GetService("Players"):GetPlayerFromCharacter(script.Parent)
if Player.Character then
local BoxingGloveRight
local BoxingGloveLeft
if Player.Character.Parent:FindFirstChild("BoxingGloveRight" .. Player.Name) then
BoxingGloveRight = Player.Character.Parent:FindFirstChild("BoxingGloveRight" .. Player.Name)
end
if Player.Character.Parent:FindFirstChild("BoxingGloveLeft" .. Player.Name) then
BoxingGloveLeft = Player.Character.Parent:FindFirstChild("BoxingGloveLeft" .. Player.Name)
end
if Player:FindFirstChild("IsWearingGloves") then
if Player.IsWearingGloves.Value == true then
if BoxingGloveRight then else
BoxingGloveRight = game.ReplicatedStorage.BoxingGloveRight:Clone()
BoxingGloveRight.Name = "BoxingGloveRight" .. Player.Name
BoxingGloveRight.Parent = Player.Character.Parent
BoxingGloveRight:SetPrimaryPartCFrame(Player.Character["Right Arm"].CFrame * CFrame.new(0, -0.9, 0))
local Weld = Instance.new("WeldConstraint", BoxingGloveRight.PrimaryPart)
Weld.Part0 = BoxingGloveRight.PrimaryPart--Player.Character["Right Arm"]
Weld.Part1 = Player.Character["Right Arm"]--BoxingGloveRight.PrimaryPart
end
if BoxingGloveLeft then else
BoxingGloveLeft = game.ReplicatedStorage.BoxingGloveLeft:Clone()
BoxingGloveLeft.Name = "BoxingGloveLeft" .. Player.Name
BoxingGloveLeft.Parent = Player.Character.Parent
BoxingGloveLeft:SetPrimaryPartCFrame(Player.Character["Left Arm"].CFrame * CFrame.new(0, -0.9, 0))
local Weld = Instance.new("WeldConstraint", BoxingGloveLeft.PrimaryPart)
Weld.Part0 = BoxingGloveLeft.PrimaryPart--Player.Character["Left Arm"]
Weld.Part1 = Player.Character["Left Arm"]--BoxingGloveLeft.PrimaryPart
end
else
if BoxingGloveRight then
BoxingGloveRight:Destroy()
end
if BoxingGloveLeft then
BoxingGloveLeft:Destroy()
end
end
end
end
end)
This script is a server script.