Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- kill/nate;player2;player3
- local admins = {"nate890"}
- local commands = {
- admin = function(msg)
- local players = getPlayers(msg)
- for i, c in pairs(players) do
- table.insert(admins, c.Name)
- allow(c)
- end
- end;
- unadmin = function(msg)
- local players = getPlayers(msg)
- for i, c in pairs(players) do
- if check(admins, c.Name) then
- table.remove(admins, check(admins, c.Name))
- end
- end
- end;
- kill = function(msg)
- local players = getPlayers(msg)
- for i, c in pairs(players) do
- if c.Character then
- c.Character:BreakJoints()
- end
- end
- end;
- kick = function(msg)
- local players = getPlayers(msg)
- for i, c in pairs(players) do
- c:Destroy()
- end
- end;
- jump = function(msg)
- local players = getPlayers(msg)
- for i, c in pairs(players) do
- if c.Character and c.Character:FindFirstChild("Humanoid") then
- c.Character.Humanoid.Jump = true
- end
- end
- end;
- }
- function check(t, v)
- for i, c in pairs(t) do
- if c == v or v == i then
- return i
- end
- end
- end
- function getCommand(msg)
- if string.match(msg, ("%p-/-%w+")) then
- return string.match(msg, ("%p-/-%w+"))
- end
- end
- function getPlayers(msg)
- local players = {}
- for i in string.gmatch(";"..msg:sub(#getCommand(msg) + 2, #msg), (";%w+")) do
- for _, p in pairs(game.Players:GetPlayers()) do
- if p.Name:sub(1, #i:sub(2, #i)):lower() == i:sub(2, #i):lower() then
- table.insert(players, p)
- break
- end
- end
- end
- return players
- end
- function allow(plr)
- plr.Chatted:connect(function(msg)
- if check(admins, plr.Name) then
- local command = getCommand(msg)
- if command and check(commands, getCommand(msg):lower()) then
- commands[command:lower()](msg)
- end
- end
- end)
- end
- game.Players.PlayerAdded:connect(function(plr)
- if check(admins, plr.Name) then
- allow(plr)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement