other = script.Parent.Parent.TextButton script.Parent.MouseButton1Click:Connect(function() wait(.23) other.Text = other.Text -2344 end)
As Incapaz said, use and if statement to check if the Value is below zero, and if it is, make it 0. Don't think you can do this with TextButton though, as those can have any Strings, Floats, or Booleans, so I would recommend putting a Value somewhere, and have it update to "other.Text"'s Value whenever it is changed.To do this, you could make an IntValue, make a script, and do something like this:
UpdateValue:
local other = --Reference the "other TextButton" from the previous script here. local CurrentOther = --Reference the IntValue here other.Changed:Connect(function() CurrentOther.Value = other.Text end)
To add on to your current code to make sure it doesn't go in the negatives:
local other = script.Parent.Parent.TextButton local CurrentOther= --Reference your IntValue here. script.Parent.MouseButton1Click:Connect(function() wait(23) other.Text = other.Text - 2344 if CurrentOther.Value < 0 then CurrentOther.Value = 0 other.Text = 0 end)