I want to make the name of a part, a number value. (to display via humanoid)
When trying, as in, Blah.Blah.Name = Blah.Blah.Value, it says it needs a string.
Any ideas on how to make it accept the number value? Number value will end up being changed every once and a while, so I can't just use a string.
DawnHorizon mentions the tostring()
function, but I think this question deserves a little more detail.
For future reference, you can refer to this page on the Official ROBLOX Wiki, a 'function dump' - a collection of many functions in ROBLOX.
Item #27 on the "Basic Functions" list is tostring()
, but if you go to the page you'll also see that #26 is a function called tonumber()
. These two functions should be learned in parallel, as one can be used as the inverse of the other.
For example, at the moment you may be wanting to set the Name
property of an Instance
to a string of a number, and for that you'd use tostring()
. Perhaps later on you'll want to retrieve the number value from the Name
of that Instance
, though, and for that you'd use tonumber()
.
For example:
number = 5 yourInstance.Name = tostring( number ) --Later, somewhere else number = tonumber( yourInstance.Name )