Hello, I would like to know if someone could provide me with a hand, I need to know how to use tostring what it does and in which use cases to use it, any ideas?
I would appreciate it very much
number = 5
new_number = tostring(number)
print("the number is: "..number)
print("The new number is: "..new_number)
number_to_number = tonumber(new_number)
print("To number is: "..tostring(number_to_number))
In your example you’ve provided, it should do as you want, name the instance to 5 and then later set the number variable to be the name of the Instance as a number. Keep in mind is that if the instance’s name is not a full number, such as if there’s a letter in it, it will set nil into number
You really only need to use tostring if you need to ensure a given value is a string