Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Message = "heck,notheck,isheck,isalsoheck,andheck"
- tab = {}
- a = 1
- lastnumber = nil
- Message = Message..",''"
- for i=1,string.len(Message) do
- if string.sub(Message,i,i) == "," and lastnumber == nil then
- table.insert(tab,a)
- table.insert(tab,string.sub(Message,1,i-1))
- lastnumber = i
- a=a+1
- elseif string.sub(Message,i,i) == "," and lastnumber ~= nil then
- table.insert(tab,a)
- table.insert(tab,string.sub(Message,lastnumber+1,i-1))
- lastnumber = i
- a=a+1
- end
- end
- value = #tab
- for i=2,value,2 do
- print("num: "..tab[i-1].."\nPlayer: "..tab[i].."\n\n")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement