Script inside of the button:
sp = script.Parent function GiveTheHat() GetID = script.Parent.Parent.ID.Text GiveIt = game:GetService("InsertService"):LoadAsset(GetID) GiveIt.Parent = game.Workspace GiveIt:MoveTo(game.Players.LocalPlayer.Character.Head.Position) end script.Parent.MouseButton1Down:connect(GiveTheHat)
The hat spawns in Workspace but does not let anyone put it on there head or creates it where the head is. Any help please? (Also if you can explain to me, how would I just ctrl + v the ID into the text instead of typing it?)
Hmm, try this instead;
repeat wait(0)until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and script.Parent and script.Parent.Parent and script.Parent.Parent:FindFirstChild("ID") local sp = script.Parent function GiveTheHat() GetID = sp.Parent.ID.Text GiveIt = game:GetService("InsertService"):LoadAsset(GetID) for i,v in pairs(GiveIt) do if v:IsA("Hat" ) or v:IsA("Tool") then v.Parent = game.Players.LocalPlayer.Character end end end script.Parent.MouseButton1Down:connect(GiveTheHat)
The reason you can't put it on your head is because all Hats have a script and a TouchInterest in them, causing them to go onto the Player's head. I suggest you insert the hat, then clone a TouchInterest and a script with Pre-Made code (just use a script inside of any free modeled hat) and clone them into the Hat you inserted.
I won't write the code for you, but I hope you understand what I mean.