local someString = "Hello world!"
local stringLength = string.len(someString)
local numberSeq = ""
for i = 1, stringLength do
numberSeq = numberSeq..i
end
print(numberSeq)
I don’t know exactly what this means, but if you want to get a number based on a string, luau has something called “tonumber(string)”, it returns nil if the string cannot be converted to a number, and returns the number in case that the string can be converted to a number, here a code example:
local String = "Hello 1234"
for _, StringElement in pairs(string.split(String, "")) do
if tonumber(StringElement) ~= nil then
print(StringElement.." Is a number!")
end
end
I understand now, to achieve this you just need to use “string.split()”, that will return a table with each letter of the string with its respective number, example code:
local String = "Hello"
print(string.split(String, ""))
Output:
I hope i helped you to solve the problem, if so, be sure to mark my reply as a solution