local minus = "2"
local current = TextLabel.Text
local now = math.abs(current) - minus
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.TextLabel.Text = now
end
end)
This is inside a local script inside a text button. When you click the text button it minus off the current number from the text label.
Lets say the text label has 100 when you click this text button the text will minus off 2 so it will become 98.
The ending has an error not sure why. Please help! Thanks in advance :)

3 comments
you need to convert the text to a number before performing arithmetic on it math.abs(tonumber(TextLabel.Text)) - tonumber(minus)
also you have an extra end inside the function, remove it
Use tonumber() and if you're using numbers, you won't be needing the quotation marks. Just say local minus = 2