Advertisement
Guest User

Untitled

a guest
Jan 10th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. local function parseConsoleInput(input)
  2.     commandInput = {}
  3.     for i in input do
  4.         if(string.sub(i,1,string.len("S:"))=="S:") then
  5.             table.insert(commandInput, i)
  6.         elseif(string.sub(i,1,string.len("I:"))=="I:" then
  7.             table.insert(commandInput, tonumber(string.sub(i, 3))
  8.         elseif(string.sub(i,1,string.len("B:")) =="B" then
  9.             bStr = string.sub(i, 3)
  10.             if(bStr == "false") then
  11.                 table.insert(commandInput, false)
  12.             else if(bStr == "true") then
  13.                 table.insert(commandInput, true)
  14.         end
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement