I really don't get on anywhere about how to use them when to use them and why you use them i would really apperocate if u know anything about it please try to explain to me.
Tostring and tonumber are ways of converting data into string or number values.
For example, if the name of one of your parts is "3", and you want to change that into a number, to be used for various things, then you could use tonumber
.
I hope this helps!
tostring() and tonumber() is basically what all these users have said. The tostring() function simply converts a number to a string, as shown below:
local numberToString = 15 print(tostring(numberToString))
The tonumber() function simply converts a string to a number, as shown below:
local stringToNumber = "15" print(tonumber(stringToNumber))
You can also check if they have changed data types by using the type() function.
local numberToString = 15 print(type(numberToString)) -- This would output 'number' local conversion = tostring(numberToString) print(type(conversion)) -- It would now output 'string'
Hope this helps.