how do i create a gui counter, that counts how many items that i clicked on an item and have a max. here is the code:

this = script.Parent isClickable = true

--Variable myMax = 5

function addCount(plr) if isClickable == true then local oreCount = plr.StarterGui.ItemCounter.Box.one if oreCount then if oreCount.Count.Value >= myMax then print("You Have Too Many") return else oreCount.Count.Value = oreCount.Count.Value+1 end else local itemCount = oreCount.Count.Value oreCount.Name = "Crystal Count: "..itemCount local count = Instance.new("IntValue", oreCount) count.Name = "Count" count.Value = 0 end end end

2 comments

0

So you want it to only let you click it 5 times?

0

yeah, befor it wont let you click it anymore