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

Getting hats from server storage?

Asked by 10 years ago
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 >= 60 then
local d = c:GetChildren()
for i=1, #d do
if d[i].className == "Hat" then
d[i]:remove()
end
end
print 'Hats Removed'
wait()
local ha = Instance.new("Hat")
ha.AttachmentForward= Vector3.new(-0, -0, -1)
ha.AttachmentPos = Vector3.new(0, 1.64, -0.01)
ha.AttachmentRight = Vector3.new(1, 0, 0)
ha.AttachmentUp = Vector3.new(0, 1, 0)
a=game.ServerStorage["Demond Hood"] ---- issue
b = a:GetChildren()
for i=1, #b do
b[i].Parent = ha -- and here
end
ha.Parent = c 
print 'Hat Added'
end
end)
print 'Hat Added'

Error: Demon Hood is not a valid part of server storage.

I'm trying to get the hat from server storage, its a handle with a mesh un-anchored and everything. I've tried putting in server storage as a model and a hat, won't work either.

0
If it's a local script, you should use replicated storage. Also, a shorter and more stable way to set the player is "game.Players.LocalPlayer". GoldenPhysics 474 — 10y
0
replicated storage gives me the same error DrChowderr 0 — 10y
0
You spelt Demon Hood "Demond Hood" Is this the error? MasterDaniel 320 — 10y
0
No ive tried spelling it differently every time and it doesnt work DrChowderr 0 — 10y

Answer this question