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

Why does my hat fall off when I go to put it on?

Asked by 5 years ago
plr = game.Players.LocalPlayer
script.Parent.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
local d = script.Parent.Parent:GetChildren() 
for i=1, #d do 
if (d[i].className == "Accessory") and (d[i].Name ~= "Cowl") then 
d[i]:Destroy() 
end 
end
local hat = Instance.new("Accessory")
hat.Name = "Cowl"
local hatpart = Instance.new("Part")
hatpart.Position = script.Parent.Parent:findFirstChild("Head").Position
hatpart.Name = "Handle"
hatpart.Size = Vector3.new(1, 0.4, 1) 
script.Parent.HatHandle.Mesh:Clone().Parent = hatpart
hatpart.Parent = hat
hatpart.BottomSurface = 0 
hatpart.TopSurface = 0
hatpart.CanCollide = false
hat.Parent = script.Parent.Parent
hat.AttachmentForward = Vector3.new (-0, -0, -1)
hat.AttachmentPos = Vector3.new(0, 0.4, 0)
hat.AttachmentRight = Vector3.new (1, 0, 0)
hat.AttachmentUp = Vector3.new (0, 1, 0)
if script.Parent.HatHandle ~= nil then
script.Parent.HatHandle:Destroy()
end
end)
end)

In the script, it gives me a hat, but instead of staying on my head, it falls through me and does stay.

0
And no errors in output EliteRayGawnX2 124 — 5y
0
Make sure its wielded to the head once you touch/ equip the hat Adenandpuppy 87 — 5y
0
Any update on this? Dr_0wn -16 — 5y

Answer this question