I want to make upgrades for my game, but at an expense to a user. When this button is clicked, it is supposed to check if the user has 50 or more pickles. If the user DOES have 50 or more, then it would take 50 pickles away and ad 1 to PPS.
Pickles = script.Parent.Parent.Pickles
PPS = script.Parent.Parent.Parent.PPS
P = 0
script.Parent.MouseButton1Click:connect(function()
if Pickles.Text == 50 .. " Pickles" then
P = P + 1
PPS.Text = P .. " Pickles Per Second"
end)

1 comment
You could make a string pattern and separate the spaces but it would be a lot easier to just store the amount of Pickles the user has in an IntValue