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

Hat giving trouble?

Asked by 8 years ago

Idea Hi, I'm trying to make it so if you enter the ID of a hat in the catalog, it places the hat on you.

Code:

v = script.Parent.Parent:findFirstChild("Load")

function onClicked()
local obj = game:service("InsertService"):LoadAsset(script.Parent.Text)
for a,hat in pairs(obj:children()) do if hat:IsA("Hat") then hat.Parent = script.Parent.Parent.Parent.Parent.Parent.Character 
end 
end
obj:Destroy()
end
v:connect(onClicked)
0
Sorry, I found the error :P. It was v:connect(onClicked) when it should've been v.Mousebutton1Click:connect(onClicked) User#9949 0 — 8y

Answer this question