-
What do you want to achieve? Admin commands
-
What is the issue? Everything works but on line 16 string.find(cmd,prefix) doesnt seem to work.
-
What solutions have you tried so far? Tried another method and it didnt work
local prefix = "/"
local cmds = {}
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
print("1")
msg = string.lower(msg)
local split = {}
local args = {}
local cmd = ""
for v in msg:gmatch("%S+") do table.insert(split,v) end
cmd = split[1]
if cmds[msg] then
if string.find(cmd,prefix) then print("2") end
if string.find(cmd,prefix) then cmds[cmd](split) end
end
end)
end)
function cmds.tp(args)
print(args[2])
end