Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Made by Memo1332/Denizen Donut you HECC
- -- This could be used as arguments for chat based commands; which it is in new MAH, however it is opensource and free to use
- unlike the other new MAH scripts that are protected by copyright.
- function seperatevars(x,sign)
- local tab = {}
- local tat = {}
- for i=1,#x do
- if string.sub(x,i,i) == sign then
- table.insert(tab,i)
- end
- end
- for i=1,#tab do
- if i ~= 1 and i ~= #tab then
- table.insert(tat,string.sub(x,tab[i]+1,tab[i+1]-1))
- elseif i == #tab then
- table.insert(tat,string.sub(x,tab[i]+1))
- elseif i == 1 then
- table.insert(tat,string.sub(x,1,tab[i]-1))
- end
- end
- return tat
- end
- local kek = seperatevars("nani,not nani,actually; yes nani,no. not nani.,AAAAAAAAAAAAAAAAAAAAAAAAAA",",")
- if kek ~= nil then
- for i=1,#kek do
- print(kek[i])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement