The script for the gui hat giver is this:

function Hat()
	local a = script.Parent.Parent.Parent.Parent.Parent.Parent.Character:GetChildren() 
	for i = 1, #a do 
		if (a[i].className == "Accessory") then 
			a[i]:remove()
			end
end
	local plyr = script.Parent.Parent.Parent.Parent.Parent.Parent
	local p = game:GetService("InsertService"):LoadAsset(tonumber(script.Parent.Name))
	p.Parent = workspace
	p:makeJoints()
	local d = plyr.Character:getChildren()
	for i = 1,#d do
		if d[i].className=="Hat" then
			d[i].Parent = nil
		end
	end
	local c = p:getChildren()
	for i = 1,#c do
		c[i].Parent = plyr.Character
		script.parent.Visible = false
	end
	p.Parent = nil
end

script.Parent.MouseButton1Down:connect(Hat)

It removes the persons hat first and then the text button's name is the code id.

4 comments

0

Is this a script or localscript?

0

is this a server script or local script?

0

oh damn we ask the same question at the same time lmao

0

This is a free model.