Advertisement
BobMe

A better version of my Muti TPS system

Feb 21st, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. Message = "heck,notheck,isheck,isalsoheck,andheck"
  2. tab = {}
  3. a = 1
  4. lastnumber = nil
  5.  
  6. Message = Message..",''"
  7.  
  8. for i=1,string.len(Message) do
  9. if string.sub(Message,i,i) == "," and lastnumber == nil then
  10. table.insert(tab,a)
  11. table.insert(tab,string.sub(Message,1,i-1))
  12. lastnumber = i
  13. a=a+1
  14. elseif string.sub(Message,i,i) == "," and lastnumber ~= nil then
  15. table.insert(tab,a)
  16. table.insert(tab,string.sub(Message,lastnumber+1,i-1))
  17. lastnumber = i
  18. a=a+1
  19. end
  20. end
  21.  
  22.  
  23. value = #tab
  24.  
  25. for i=2,value,2 do
  26. print("num: "..tab[i-1].."\nPlayer: "..tab[i].."\n\n")
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement