How to use Text String to give the value to any variable

In order to develop a GUI interface for a vehicle, so need to set its initial velocity through the control panel–the interface. Question is how to use PtText and PtButton to achieve it like input a number 10 and click the button to give this number to a variable “velocity” to set the maximum velocity of the vehicle, anyone have suggestions or examples about PtText? Thank you!

This is lazyness in my opinion, you should read the documentation first and experiment yourself.