In principle, the title already says what error is about. When the textbox is empty it gives this error. What to do? I will be grateful. Here is the script where this error occurs:
local ConvertFrame = script.Parent:WaitForChild("ConvertFrame")
local TextBoxConvert = ConvertFrame:WaitForChild("TextBoxConvert")
local FinallyValue = ConvertFrame:WaitForChild("FinallyValue")
local ButtonConvert = ConvertFrame:WaitForChild("ConvertButton")
local player = game.Players.LocalPlayer
local TimeStats = player.TimeFolder:WaitForChild("TimeValue")
local TimeChange = game.ReplicatedStorage:WaitForChild("TimeValueChange2")
local Amountt = 1
TextBoxConvert.Focused:Connect(function()
TextBoxConvert:GetPropertyChangedSignal("Text"):Connect(function()
FinallyValue.Text = TextBoxConvert.Text:gsub("%D+", "") - tonumber(Amountt)
end)
end)
ButtonConvert.MouseButton1Click:Connect(function()
local text = TextBoxConvert.Text
TimeChange:FireServer(text)
end)