menu
Roblox Forum Archive
Home
User Search
Forums
Donate
search
settings
Home
User Search
Forums
Donate
launch
Go to User Dashboard
Forums
Scripters
a string of numbers
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right
a string of numbers
LuaAtrocities
Join Date: 2012-01-15
Post Count: 617
#182993980
Thursday, February 04, 2016 7:36 PM GMT
So if someone were to input something like '1,2,34,4,5,6,7', how would I turn this into a table of numbers?
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
LuaAtrocities
Join Date: 2012-01-15
Post Count: 617
#182994257
Thursday, February 04, 2016 7:43 PM GMT
nevermind.
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
BanTech
Join Date: 2015-12-31
Post Count: 886
#182994316
Thursday, February 04, 2016 7:44 PM GMT
In case anyone else wants to know a method: local t = {} for digit in string.gmatch("1,2,34,4,5,6,7", "%d+") do table.insert(t, tonumber(digit)) end
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
ez_street
Join Date: 2013-07-11
Post Count: 364
#182996820
Thursday, February 04, 2016 8:35 PM GMT
local NumberTable = {} for number in string.gmatch("1,2,34,4,5,6,7", "%d+") do local number = tonumber(number) table.insert(NumberTable, number) end
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
BanTech
Join Date: 2015-12-31
Post Count: 886
#182998767
Thursday, February 04, 2016 9:13 PM GMT
^ thanks for writing the same thing using more lines?
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right