Question about string.split

I’m creating a command bar for my admin panel but I’m a bit confused on how to use string.split

example command:
kick ecoxttv spamming in chat

Once this command is entered I am kicked for “spamming” because of the string.split seperates everything by a space which means it doesn’t know that I want to keep that whole bit.

Does anybody know a solution?

I made a function a while ago because i also made an admin system. it pieces back the rest of the string using iteration and string concentation. Do you want to see it and infer off of it?

Yes that would be helpful, thank you

local reason = ""
for i,v in message do
	if i >= 3 then
		reason = reason.." "..v
	end
end

The i >= 3 makes it only take the messages split after your command and the person being banned
i think this should work for you as it did for me

This does work perfectly, thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.