Title sounds confusing, I know. But here's the thing.
I have a folder filled with Parts. Those parts have names from 1 to 35. So for example: grid1, grid2, grid3, grid4... So how would I take that number from its name and put it in a NumberValue?
Title sounds confusing, I know. But here's the thing.
I have a folder filled with Parts. Those parts have names from 1 to 35. So for example: grid1, grid2, grid3, grid4... So how would I take that number from its name and put it in a NumberValue?
I would do it like this, maybe there is better way but this one works as well:
local part = script.Parent
print(string.sub(part.Name, 5, #part.Name))
well so string sub subs it yeah and #part.Name means how much letters does name have, the number 5 means how much letters before that number, it must be on 1 higher so example:
cube = 5 car = 4
Hope i explained it right tho
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Thank you! You led me to the right track!