Multiply the TextBox value by a Random.New value

Hi, I am trying to make a simple betting system where the user inserts their bet into a textbox and then clicks the bet button. This generates a random integer which is supposed to multiply against the bet value and print to the output.

local bet = script.Parent.Parent.TextBox.Text
local GenNumber = Random.new()
script.Parent.MouseButton1Click:Connect(function()
	
	

	script.Parent.Parent.TextLabel.Text = GenNumber:NextNumber(0,2)
	
end)
print(bet*GenNumber:NextNumber())

Here is also a screenshot of my UI layout

and here is the error that the output shows, 22:06:03.719 Players.Timsaay.PlayerGui.ScreenGui.Frame.TextButton.LocalScript:10: attempt to perform arithmetic (mul) on string and number - Client - LocalScript:10

You have to update bet whenever the text is changed, and print it inside of the event.

You can use tonumber() to validate that the textbox contains a string value which can be coerced into a number value before attempting to multiply it.