This is probably a very silly question that is easy to solve, but i have looked for hours and have been unable to solve my problem. I would like to be able to take a user input (into my text box) and save the input onto a server, datastore would be the obvious one but I have tried getting this to work and it did not work. My method was to create a variable:
SERVERINFO = TextBox.Text
and use that variable to save information to the server but it has not seemed to work. Any help would be greatly appreciated!
Many thanks :)

4 comments
If you want it simplified to the bare minimum, you would use _G to create a global variable for all ServerScripts to have access to. So, it'd be _G.WhatEverYouWant = TextBox.Text
^ That won't save whenever the player leaves, but will always be that while the player is still in the game.
HeavenlyBlobmaster has a really good answer! Also, you can use a datastore to save data before it gets overwritten using a global-function i believe is called PropertiesChanged
This is a request so downvoted my man