Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Players = game:GetService("Players")
- LocalPlayer = Players.LocalPlayer
- local Commands = {}
- local Settings = {['Prefix'] = ";"}
- local function AddCmd(CmdName, Aliases, Desc, Func)
- Commands[#Commands + 1] = {["Name"] = CmdName, ['Other'] = Aliases, ["Description"] = Desc, ["Function"] = Func}
- addCmdtolist(CmdName, Aliases, Desc)
- end
- local function Search(CmdName)
- for _, v in next, Commands do
- if v.Name == CmdName or table.find(v.Other, CmdName) then
- return v.Function
- end
- end
- end
- local function CheckCmd(Cmd)
- if Cmd ~= "" and Cmd ~= Settings.Prefix and Cmd ~= " " then else return end
- Cmd = string.lower(Cmd)
- if Cmd:sub(1, #Settings.Prefix) == Settings.Prefix then
- local Args = string.split(Cmd:sub(#Settings.Prefix + 1), " ")
- local CmdName = Search(table.remove(Args, 1))
- if CmdName and Args then
- return CmdName(Args)
- end
- end
- end
- LocalPlayer.Chatted:Connect(function(msg)
- CheckCmd(msg)
- end)
Add Comment
Please, Sign In to add comment