Detect what number player is typing into text box

im trying to make a rendering distance control where the player types a number 1-10 into the textbox and whatever number they put in will change the rendering.qualitylevel by 2 numbers but i dont know how to detect what number a player has typed into the text box. any help is appreciated

local TextBox = script.Parent -- Example
if Enter == true then -- Checks if EnterKey Is Pressed.
local Number = tonumber(TextBox.Text)
if Number then -- checks if the textbox has only numbers if not it will not continue.
--- stuff here.
local TextBox = -- destination

if TextBox.Text:match("%d+") then -- Checks for a number
  print(TextBox.Text) -- Should print the integer 

1 Like

how can i make it where an event only triggers when a certain number is typed i.e. rendering.qualitylevel goes to 2 when player types 1 into the box

you can check for the number by doing

if Number == 1 then
-- stuff here

but unfortunately i think you cant edit the roblox rendering qualitylevel

oh that sucks thanks for letting me know

1 Like