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

How would I weld the hat into the players head?

Asked by 6 years ago

I was told I needed to weld the hat into the players head, although with that I have no actual idea how to weld things (I script GUIs and stuff but not items) How would I do this?

This is my script

01local Player = game.Players.LocalPlayer
02 
03local HatsAvailable = {}
04 
05local Count = 0
06 
07local LeftButton = script.Parent.LeftHat
08 
09local RightButton = script.Parent.RightHat
10 
11for i,v in pairs(game.ReplicatedStorage.ClothingLow.HatsLow:GetChildren()) do
12    table.insert(HatsAvailable,v)
13end
14 
15function RemoveCurrentHats()
View all 54 lines...

Like I said no actual idea how to weld anything

1 answer

Log in to vote
1
Answered by 6 years ago

If you need to weld the hat on then first you gotta create a new instance. Try putting this in

1local HatTheyBoughtClone = HatsAvailable[Count]:Clone()
2local WeldPiece = Instance.new("Weld") --create weld part
3HatTheyBoughtClone.Handle.Position = Player.Character.Head.Position
4WeldPiece.Part0 = Player.Character.Head --connects hat and head {
5WeldPiece.Part1 = HatTheyBoughtClone
6WeldPiece.C0 = CFrame.new(0, 0, 0)
7WeldPiece.Parent = Player.Character.Head --}
8Player.Character.Humanoid:AddAccessory(HatTheyBoughtClone)

Hope that answers your question :D

0
Thanks I can figure out how to reposition it Sergiomontani10 236 — 6y
Ad

Answer this question