Lets say I want a model to be called "Car One" based on a value (1) so if the value is 4, the model will be called "Car Four". I'm wondering if there's a shortcut to turn number values to words.
You can easily do this by concatenation. But first, you need to make a Dictionary
. Dictionaries are essentially tables with keys and values.
So, lets make a dictionary with keys of the full word, and values of the number. Then according to the number value, iterate through the table. If there's a match then concatenate the key with the model name.
local nums = { ['One'] = 1, ['Two'] = 2, ['Three'] = 3, ['Four'] = 4 } local numVal = workspace.NumberValue --Just an example local model = workspace.Car for i,v in pairs(nums) do if v == numVal.Value then model.Name = model.Name..i end end