Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

GUI Hat Shop?

I am creating a GUI hat shop, this code is positioned inside the GUI button within frame within the GUI. The script does not throw a error but does not work either.

wait(0.5)
player = script.Parent.Parent.Parent.Parent.Parent
money = player.leaderstats.Wins
price = 0


function buy()
if money.Value >= price then
		if (player:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Hat")
		p = Instance.new("Part")
		h.Name = "SidesweptBangsBrown"
		p.Parent = h
		p.Position = player:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = script.Parent.formFactor
		p.Size = Vector3.new(1, 1, 1) 
		p.BottomSurface = 0 
		p.TopSurface = 0 
		p.Locked = true 
		game.Workspace.THat1.Mesh:clone().Parent = p
		h.Parent = player
        h.AttachmentForward = Vector3.new(0.196, -0, -0.981)
		h.AttachmentPos = Vector3.new(0.12, 0.3, -0.07)
        h.AttachmentRight = Vector3.new(0.981, 0, 0.196)
        h.AttachmentUp = Vector3.new(0, 1, -0)
		wait(5)
		debounce = true
	end


end
end
script.Parent.MouseButton1Down:connect(buy)

1 answer

I took a quick look at the script, try putting these fixes in:

function buy()
if money.Value > or == price then --Saying if the price is the same or higher than the price
        if (player:FindFirstChild("Humanoid") ~= nil and debounce == true) then--FindFirstChild, every 
--word is upper case

Not sure if this will work but those are the things I noticed when I took a quick look at the script

This discussion is preserved as it was. New answers, comments, and votes are closed.