If you are looking to make a textedit box that controls something that requires to be of a specific range of values, like an integer between 30 and 165 for the in game fps limit multiplier, then look at this code.
`extends LineEdit

func process(delta: float) -> void:
if SaveManager.data["graphics"]["fps_limit_toggle"] == "false":
self.editable = false
self.placeholder_text = "N/A"
elif SaveManager.data["graphics"]["fps_limit_toggle"] == "true":
self.editable = true
self.placeholder_text = str(SaveManager.data["graphics"]["fps_limit"])

func _on_text_submitted(new_text: String) -> void:
if 29 < int(new_text) and int(new_text) < 166:
SaveManager.data["graphics"]["fps_limit"] = int(new_text)
SaveManager.local_save_all()
else:
self.delete_text(0, 3)
SaveManager.data["graphics"]["fps_limit"] = 165
SaveManager.local_save_all()`

Here's the breakdown of how this works…

To get the file started, I attached a script directly to the LineEdit node I'm using, then I connected a signal to itself ("_on_text_submitted") which tells the script when and what is inputted when u press enter. I also set apart that controls the save file, if you're looking for how to do a JSON save look at this video [ but to put it simply, I'm setting a variable at runtime, then running a save function so it stays even after you close the game.

Let's go to the bottom half, to limit it to a range of integers, I made an if statement that said if the number is an integer between 30 and 165, then make it a runtime variable, and save it to my JSON save file. If the entered value is not an integer between 30 and 165, it deletes the text and saves a default number to the script. Make sure to set the minimum (29 < int(new_text)) to be one less than what you want, same goes for the maximum, just with add 1 instead of subtract.

Now let's talk about the top portion, this portion controls if you can edit the text at all, and if u can, it will display the current set value as a background placeholder. I made it like this so u can see which variables u have edited at runtime, in case u mess something up and wanna change it back (runtime edited text is brighter than placeholder, which has not been edited in current runtime). The main if and elif statements check that you can set a custom limit on the fps, if not, then u can't edit the box, and it will say N/A. If you can set a custom fps limit, then it makes the box editable, and it displays the initial value from the save file as a placeholder text, if u change the value and press enter the new value is brighter, and thus makes it easier to see the recently changed setting if u want to change it again. Make sure to give a cue that the value has saved by adding something like a green border for a second when u submit the text.

Note: this code is my original code, feel free to copy/paste it, but u may need to change the variable's names to adapt it to your project.

    linuxelite69 Srry i mis worded the end part, all of the code i put in the guide itself is my own, the savemanager code belongs to the youtuber who made that awesome guide.

    linuxelite69

    Try to put your code block within triple ```

    func someFunction():
      ...some code