I am making a click to earn game, like make it rain. I have a textbox that starts out as "0 Pickles", and when they click the imagebutton, (a pickle) it increases the number in the textbox by one. Here is some code I tried below.
Pickles = script.Parent.Parent.Pickles function onClick() Pickles.Text = " +1 Pickles" end script.Parent.MouseButton1Click:connect(onClick)
You need to have an independent value for the function to refer to.
Try something like this :
Pickles = script.Parent.Parent.Pickles N = 0 script.Parent.MouseButton1Click:connect(function() N = N + 1 Pickles.Text = N .. " Pickles" end) -- N works as a counter each time you click
I hope this helped!
TheArmoredReaper