Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lastKey = 0
- local allStrings = {}
- function ReplaceString(str, find, replace)
- str = tostring(str)
- local strStart, strEnd = str:find(find)
- return str:sub(1, strStart-1) .. replace .. str:sub(strEnd+1, #str)
- end
- function ParseText(text, endKey)
- for i = 1, #text do
- if text:sub(i,i) == endKey then
- if lastKey == 0 then
- table.insert(allStrings, ReplaceString(text:sub(1,i), endKey, ""))
- lastKey = i + 1
- else
- table.insert(allStrings, ReplaceString(text:sub(lastKey, i), endKey, ""))
- end
- end
- end
- end
- function execute()
- ParseText(script.Parent.Output.CmdBar.CommandBar.Text,"|")
- print(allStrings[1],allStrings[2])
- end
- script.Parent.Output.CmdBar.Execute.MouseButton1Click:connect(execute)
- I get this in output: /kill nil
- But in the textbox I wrote "/kill|LeRiceFarmer"
- Why is it nil?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement