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

Gui Weld Script??

Asked by 10 years ago

OK, so I'm trying to make a GUI button that when clicked puts a weld on the player, the script I've got isn't working, so any help or advice on why would be greatly appreciated.

gui = script.Parent
button2 = gui.ImageButton2
Player = script.Parent.Parent
c = Player.character
x = Instance.new("Part")
x.Size = Vector3.new(1, 3, 1)
x.Parent = c
arm = c["Right Arm"]

button2.MouseButton1Down:connect(function ()
w1 = Instance.new("Weld", arm) --Setting the Parent to "arm"
w1.Part0 = arm --Also setting the Part0 to "arm"
w1.Part1 = x
w1.C1 = CFrame.new() --Setting C1, not "c1".
end)

Answer this question