Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make parts weld onto a player?

How do I make parts weld onto a player when they click a GUI button?

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

1 comment

0

How would I put it all together?

This discussion is preserved as it was. New answers, comments, and votes are closed.