this script worked, it was just too slow:
local p = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent
local c = p.Character
script.Parent.MouseButton1Up:connect(function()
if p.leaderstats.Lvl.Value >= 55 then
local d = c:GetChildren()
for i=1, #d do
if d[i].className == "Hat" then
d[i]:remove()
end
end
wait()
local h = Instance.new("Hat")
h.AttachmentForward= Vector3.new(-0, -0, -1)
h.AttachmentPos = Vector3.new(0, 0.2, 0)
h.AttachmentRight = Vector3.new(1, 0, 0)
h.AttachmentUp = Vector3.new(0, 1, 0)
a=game:GetService("InsertService"):LoadAsset(166900742)
b = a:GetChildren()
for i=1, #b do
b[i].Parent = h
end
h.Parent = c
end
end)
So I changed this:
a=game:GetService("InsertService"):LoadAsset(166900742)
to this
a=ServerStorage.DemonHood
but now it wont get the hat all, just removes your current hat.
The hat is inside a model, named DemonHood, and inside is the part with the mesh, also named demon hood.
|