I am currently making an admin module for my new game. I set the chat so it sets an argument for every space in the chat. I started off with a simple kick command, but instead of the chat reading "~kick", it would kick a player as long as there was a first argument (whether or not it was a valid command). Here is my module script:
local prefix = "~"
local admin = {}
local cmds = {}
cmds[1] = prefix.. "Kick"
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
local args = string.split(msg, " ")
local cmd = args[1]
local target = args[2]
local stringText = args[3]
--CommandStart----------------------------------------------------
if args[1] == string.lower(cmds[1]) or string.upper(cmds[1]) then
--kick function here
end
--CommandEnd------------------------------------------------------
end)
end)
If I worded it badly, I am simply saying that the function will run even if the first argument isn't "~kick".

1 comment
Thank you, I'll give that a shot