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 9 years ago

(This a normal script, not local)

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.DemondHood ---- The issue
b = a:GetChildren()
for i=1, #b do
b[i].Parent = ha
end
ha.Parent = c 
end
end)
print 'Hat Added'

Trying to get the hat from server storage and onto the player, but I keep getting the error "DemonHood is not part of server storage"

0
Try game.ServerStorage:WaitForChild("DemonHood") Perci1 4988 — 9y
0
It prints "hat added" but doesnt give the hat DrChowderr 0 — 9y

Answer this question