Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(3)
- warn("Begun loading command base.")
- local SelectedPlayer = ""
- local Found = false
- local SettingsModule = require(game.ServerScriptService.JumpsAdmin.Settings)
- local Prefix = SettingsModule.Prefix
- local AdminList = {}
- local OwnerList = {}
- local ModeratorList = {}
- local PlayerList = {}
- local Commands = {} -- coming soon idk
- local IsStaff = false
- for i,v in pairs(SettingsModule.Owners) do
- table.insert(OwnerList, i, v)
- end
- for i,v in pairs(SettingsModule.Admins) do
- table.insert(AdminList, i, v)
- end
- for i,v in pairs(SettingsModule.Moderators) do
- table.insert(ModeratorList, i,v)
- end
- local CheckStaff = function(name)
- local player = game.Players[name]
- local AdminLevel = 0
- local IsAdmin = false
- local v = player
- for i,k in pairs(ModeratorList) do
- if v.Name == k then
- AdminLevel = 1
- IsAdmin = true
- end
- for i,k in pairs(AdminList) do
- if v.Name == k then
- AdminLevel = 2
- IsAdmin = true
- end
- end
- end
- for i,k in pairs(OwnerList) do
- if v.Name == k then
- AdminLevel = 3
- IsAdmin = true
- end
- end
- if IsAdmin == true then
- IsStaff = true
- else
- IsStaff = false
- end
- end
- local FindPlayer = function(name)
- local String
- String = string.sub(name,1,4)
- local Text = string.lower(String)
- String = Text
- print(String)
- for i,v in pairs(game.Players:GetPlayers()) do
- local Lowered = string.lower(v.Name)
- if Lowered:sub(1, 4) == String then
- SelectedPlayer = v.Name
- Found = true
- end
- end
- end
- local Ban = function(playername)
- local plr = game.Players[playername]
- local IsAdmin = false
- for i,v in pairs(OwnerList) do
- if v == playername then
- IsAdmin = true
- end
- end
- for i,v in pairs(AdminList) do
- if v == playername then
- IsAdmin = true
- end
- end
- for i,v in pairs(ModeratorList) do
- if v == playername then
- IsAdmin = true
- end
- end
- if IsAdmin == true then
- warn("User is an admin, lmao.")
- else
- local DataStore = game:GetService("DataStoreService"):GetDataStore("JumpsAdminBans2")
- plr.BanCheck.Value = 15
- local success, errormessage = pcall(function()
- DataStore:SetAsync(plr.UserId.."-ban",plr.BanCheck.Value)
- end)
- plr:Kick("You have been banned from this game!")
- end
- end
- if game:GetService("RunService"):IsStudio() then
- warn("You will not have admin here, unless you're on the lists, due to studio place id issues to automatically add you to the list.")
- else
- local PlaceId = game.PlaceId
- local PlaceInfo = game:GetService("MarketplaceService"):GetProductInfo(PlaceId)
- local GameOwner = 0
- if PlaceInfo.Creator.CreatorType == "Group" then
- GameOwner = game:GetService("GroupService"):GetGroupInfoAsync(PlaceInfo.Creator.CreatorTargetId).Owner.Name
- elseif PlaceInfo.Creator.CreatorType == "User" then
- GameOwner = PlaceInfo.Creator.Name
- end
- table.insert(OwnerList,1,GameOwner)
- end
- local ChatFunction = function(plrname)
- local v = game.Players[plrname]
- v.Chatted:Connect(function(msg)
- local AdminLevel = 0
- local IsAdmin = false
- for i,k in pairs(ModeratorList) do
- if v.Name == k then
- AdminLevel = 1
- IsAdmin = true
- end
- for i,k in pairs(AdminList) do
- if v.Name == k then
- AdminLevel = 2
- IsAdmin = true
- end
- end
- end
- for i,k in pairs(OwnerList) do
- if v.Name == k then
- AdminLevel = 3
- IsAdmin = true
- end
- end
- if IsAdmin == true then
- local MLength = #msg
- local String = msg:lower()
- if String:sub(1,6) == ""..Prefix.."kill " then
- if AdminLevel >= 1 then
- local Target = nil
- FindPlayer(string.sub(msg,7,11))
- wait(0.1)
- if Found == true then
- Target = game.Players[SelectedPlayer].Character
- end
- if Target == nil then
- warn("Player returned as nil, or left the game.")
- else
- Target.Humanoid.Health = 0
- end
- end
- else
- if String:sub(1,9) == ""..Prefix.."skydive " then
- if AdminLevel >= 1 then
- local Target = nil
- FindPlayer(string.sub(msg,10,14))
- wait(0.1)
- if Found == true then
- Target = game.Players[SelectedPlayer].Character
- end
- if Target == nil then
- warn("Player returned as nil, or left the game.")
- else
- local Root = Target.HumanoidRootPart
- local X = Root.CFrame.X
- local Y = Root.CFrame.Y + 2000
- local Z = Root.CFrame.Z
- Root.CFrame = CFrame.new(X,Y,Z)
- end
- end
- else
- if String:sub(1,4) == ""..Prefix.."sm " then
- if AdminLevel >= 1 then
- local Message = string.sub(msg,4,#msg)
- local filtered = game:GetService("Chat"):FilterStringForBroadcast(Message,v)
- for i,n in pairs(game.Players:GetPlayers()) do
- local GUI = script.Parent.Parent.Assets.SM:Clone()
- GUI.Message.Text = ""..v.Name..": "..filtered..""
- GUI.Parent = n.PlayerGui
- end
- end
- else
- if String:sub(1,6) == ""..Prefix.."kick " then
- if AdminLevel >= 2 then
- local Target = nil
- FindPlayer(string.sub(msg,7,#msg))
- wait(0.1)
- if Found == true then
- Target = game.Players[SelectedPlayer]
- end
- if Target == nil then
- warn("Player returned as nil, or left the game.")
- else
- CheckStaff(Target.Name)
- wait(0.1)
- Target:Kick("You have been kicked by an admin!")
- end
- end
- else
- if String:sub(1,5) == ""..Prefix.."ban " then
- if AdminLevel >= 2 then
- local Target = nil
- FindPlayer(string.sub(msg,6,#msg))
- wait(0.1)
- if Found == true then
- Target = game.Players[SelectedPlayer]
- end
- if Target == nil then
- warn("Player returned as nil, or left the game.")
- else
- Ban(Target.Name)
- end
- end
- else
- if String:sub(1,7) == ""..Prefix.."unban " then
- if AdminLevel >= 2 then
- local Them = msg:sub(8,#msg)
- warn(Them)
- local ID = nil
- local DataStore = game:GetService("DataStoreService"):GetDataStore("JumpsAdminBans2")
- local Players = game:GetService("Players")
- ID = Players:GetUserIdFromNameAsync(Them)
- warn("Unbanning: "..ID.."")
- local success, errormessage = pcall(function()
- DataStore:SetAsync(ID.."-ban",0)
- end)
- if success then
- warn("Unbanned! :D")
- end
- end
- else
- if String:sub(1,5) == ""..Prefix.."mod " then
- if AdminLevel >= 2 then
- local Target = nil
- FindPlayer(string.sub(msg,6,#msg))
- wait(0.1)
- if Found == true then
- Target = game.Players[SelectedPlayer]
- end
- if Target == nil then
- warn("Player returned as nil, or left the game.")
- else
- table.insert(ModeratorList, Target.Name)
- end
- end
- else
- if String:sub(1,7) == ""..Prefix.."admin " then
- if AdminLevel >= 3 then
- local Target = nil
- FindPlayer(string.sub(msg,8,#msg))
- wait(0.1)
- if Found == true then
- Target = game.Players[SelectedPlayer]
- end
- if Target == nil then
- warn("Player returned as nil, or left the game.")
- else
- table.insert(AdminList, Target.Name)
- end
- end
- else
- if String == ""..Prefix.."cmds" then
- local Help = script.Parent.Parent.Assets.HelpMenu:Clone()
- local Pr = Help:WaitForChild("Main"):WaitForChild("Prefix")
- Pr.Value = Prefix
- Help.Parent = v.PlayerGui
- else
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end)
- end
- warn("Done, beginning the loop process.")
- while wait(0.1) do
- for i,v in pairs(game.Players:GetPlayers()) do
- if game.ServerStorage.JumpsAdminData[v.Name].Value == false then
- game.ServerStorage.JumpsAdminData[v.Name].Value = true
- ChatFunction(v.Name)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement