Issues with cash drop system

Hello Devs, I have this code when the player enters a number and presses drop, It drops cash and when clicked it adds to the players original cash.
But I have this issue where when the inputs something like this 55ssg and presses drop it still drops the cash but of course it does not add to the cash

local remote = game.ReplicatedStorage.RemoteEvents

script.Parent.TextButton.MouseButton1Click:Connect(function()
    if string.match(script.Parent.TextBox.ContentText, '%d') then
        remote:FireServer(script.Parent.TextBox.Text)
        end
end)
1 Like

I would recommend looking at a topic like this that discusses how to make number only TextBoxes: How would I create a number only TextBox?

1 Like