I've seen it alot but I can't find any explanation. Could someone explain what it does and what it is used for?
tostring converts a Number Value such as 1,2,3..99 etc. into a String
For example tostring("50") converts the string "50" to the number 50 Example usage is shown here, which is copied from the wiki:
print("50" == 50) -- false, because a string is not equal to a number. print(tostring(50) == "50") -- true, because you converted the number 50 to a string print(tonumber("50") == 50) -- true, because you converted the string "50" to a number print(50 .. "" == "50") -- true, because you tacked on an empty string to the end of the number 50, converting 50 to a string.
Source: https://developer.roblox.com/en-us/articles/String