How do I make parts weld onto a player when they click a GUI button?
✓ ANSWER ACCEPTED
How do I make parts weld onto a player?
1 answer
✓ Accepted answer
You would use the
TextButton.MouseButton1Down:connect()
event for when a Text Button is clicked, you would then need to create a new part and position it
player = game.Players.LocalPlayer
x = Instance.new('Part',workspace)
x.CFrame = player.Character.Head.CFrame * CFrame.new(0,0,-5)
Then you would now need to weld the part to the players head, which can be achieved like this:
local w = Instance.new('Weld')
w.Name = 'Weld'
w.Part0 = player.Character.Head
w.Part1 = x
w.C0 = player.Character.Head.CFrame:inverse()
w.C1 = x.CFrame:inverse()
w.Parent = player.Character.Head
-- If I helped you leave a +1 Reputation <3
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
How would I put it all together?