Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local isAnAdmin = game.ServerScriptService.RemoteFunctions.AdminChecker.Function
- local acceptedCommands = {"kick", "ban", "kill", "f3x", "banish"}
- function matchPlayer(str)
- local result = nil
- for _,v in pairs(game.Players:GetPlayers()) do
- if (string.find(string.lower(v.Name), str) == 1) then
- if (result ~= nil) then return nil end
- result = v
- end
- end
- if result == nil then
- return nil
- else
- return result
- end
- end
- function getCommand(msg)
- if msg:sub(1,1) == "/" or msg:sub(1,1) == ":" then
- msg = msg:sub(2,-1):lower()
- return msg:split(" ")
- end
- return {}
- end
- function commandDetect(msg)
- for _,v in pairs(acceptedCommands) do
- if string.sub(msg,2,string.len(v)+1) == v then
- for word in msg:gmatch("%w+") do
- if word ~= v then
- local match = matchPlayer(word)
- return v, match
- end
- end
- return v, nil
- end
- end
- end
- --[[Admin Commands (older one)
- game.Players.PlayerAdded:connect(function(p)
- if isAnAdmin:Invoke(p) == true then
- print("Enabling admin commands for "..p.Name)
- p.Chatted:connect(function(m)
- local msg = string.lower(m)
- local char = string.sub(msg,1,1)
- if char == ":" or char == "/" then
- local cmd, plr = commandDetect(msg)
- if plr ~= nil and cmd ~= nil then
- if cmd == "kick" then
- if isAnAdmin:Invoke(plr) ~= true then
- plr:Kick()
- end
- elseif cmd == "ban" then
- if isAnAdmin:Invoke(plr) ~= true then
- game.ServerScriptService.RemoteEventListeners.AdminFunctions.BanRequest:Fire(p,plr)
- end
- --elseif cmd == "kill" then
- -- plr.Character:BreakJoints()
- --end
- end
- end
- end)
- end
- end)]]
- --Admin Commands
- game.Players.PlayerAdded:connect(function(p)
- if isAnAdmin:Invoke(p) == true then
- print("Enabling admin commands for "..p.Name)
- p.Chatted:connect(function(msg)
- local args = getCommand(msg)
- if args[1] == "kick" then
- local plr = matchPlayer(args[2])
- if plr ~= nil then
- if isAnAdmin:Invoke(plr) ~= true then
- plr:Kick()
- end
- end
- elseif args[1] == "ban" then
- local plr = matchPlayer(args[2])
- if plr ~= nil then
- if isAnAdmin:Invoke(plr) ~= true then
- game.ServerScriptService.RemoteEventListeners.AdminFunctions.BanRequest:Fire(p,plr)
- end
- end
- --[[elseif args[1] == "kill" then
- plr.Character:BreakJoints()
- ]]
- end
- end)
- end
- end)
- --SuperAdmin Commands
- game.Players.PlayerAdded:connect(function(p)
- local check1, check2 = isAnAdmin:Invoke(p)
- if check1 == true and check2 == true then
- print("Enabling super admin commands for "..p.Name)
- p.Chatted:connect(function(msg)
- local args = getCommand(msg)
- if args[1] == "f3x" then
- local tool = game.ServerStorage.F3X:Clone()
- tool.Parent = p.Backpack
- elseif args[1] == "banish" then
- local target = matchPlayer(args[2])
- local placeID
- if args[3] == "lgbt" then
- placeID = 3380011801
- elseif args[3] == "furry" then
- placeID = 1749851289
- else
- placeID = tonumber(args[3]) or 1749851289
- end
- if placeID ~= nil and target ~= nil then
- game:GetService("TeleportService"):Teleport(placeID, target)
- end
- end
- end)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement