How do I make parts weld onto a player when they click a GUI button?
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