Here is my script. It gives the hat and everything, except it doesn't stick the the players head:
local debounce = true
local timeinterval = 1
local mesh = script.Parent.Mesh
script.Parent.Touched:connect(function(player)
local humanoid = player.Parent:FindFirstChild("Humanoid")
if humanoid then
print("there is humanoid")
if not debounce then
return
end
debounce = false
--HatGive--
local hat = Instance.new("Hat")
local handle = Instance.new("Part")
local newmesh = mesh:Clone()
hat.Name = "GivenHatTesting"
hat.Parent = player.Parent
hat.AttachmentPos = Vector3.new(0, 0.6, 0)
handle.Parent = hat
handle.Position = player.Parent:FindFirstChild("Head").Position
handle.Name = "Handle"
handle.Size = Vector3.new(0,-0.25,0)
handle.BottomSurface = 0
handle.TopSurface = 0
handle.Locked = true
handle.formFactor = 0
newmesh.Parent = handle
--HatGive--
wait(timeinterval)
debounce = true
end
end)
why wont it weld to the characters head? ty for feedback pls

2 comments
It works thanks so much! I dont really use welds because I dont use them correctly so they seem difficult lol but it worked!
Youre welcome my dude! Anything I can do to help :)