Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Need helping getting this weld script to work properly. Any ideas?

Asked by
zadobyte 692 Moderation Voter
5 years ago
Edited 5 years ago

So basically, I wanna attach a wristband type of accessory onto the characters arm, however, the code I have isn't allowing me to do that

01local parent = script.Parent
02local PrimaryPart = parent.PrimaryPart
03local player = game:GetService("Players").LocalPlayer
04local character = player.Character or player.CharacterAdded:Wait()
05local RArm = character["Right Arm"]
06 
07local weld = Instance.new("Weld")
08 
09weld.Part0 = PrimaryPart
10weld.Part1 = RArm
11weld.C0 = PrimaryPart.CFrame:inverse()
12weld.C1 = RArm.CFrame:inverse()
13weld.Parent = PrimaryPart
14wait()

What can I fix to get it to weld?

Answer this question