Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script.Parent = nil
- PermaAdmins = {"Computer1326","Corecii","edvardsonic"} --Add your name how those are.
- Ban = {} --Banned players
- Loopkill = {} --Loopkilled
- AdminedRestrictions = {"permaadmin","admin","loopkill","ban","kick","loopkill","ff","unff","c"} --People who are admined cannot use these.
- Admins = {} --Add to this like you do PermaAdmins, Admins cannot use any of the commands above.
- AdminItemId = {} --Go to the item you want players to need to get admin. Copy the ID at the end of the Adress/URL. This can be a T-Shirt, Shirt, Pants, Badge, Model, Image, Hat, Gear, Head, Face, Package, Decal. Add it to the table.
- FrontZ = {"adminc","cycommands","commands","admin"} --Add here so you can say things like(example): /sc\kick/Name or adminc\kick/name
- --The above can be used to allow this script to not interfere with other command scripts.
- -----Do not edit anything below.
- Scripts = {}
- --[[for j, v in pairs(PermaAdmins) do
- table.insert(Admins,v)
- end]]
- --[[
- = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- end
- end,
- ]]
- Commands = {
- newteam = function(p,P)
- pcall(function()
- local TEAMC = BrickColor.new(p[2])
- local I = Instance.new("Team",game:GetService("Teams"))
- I.Name = tostring(p[1])
- I.TeamColor = TEAMC
- I.AutoAssignable = false
- end)
- end,
- changeteam = function(p,P)
- pcall(function()
- local TEAMC = game:GetService("Teams"):findFirstChild(p[2])
- if not TEAMC or not TEAMC:IsA("Team") then return end
- for j, v in pairs(CheckPerson(P,p[1])) do
- v.TeamColor = TEAMC.TeamColor
- end
- end)
- end,
- removeteam = function(p,P)
- for j, v in pairs(p) do
- pcall(function() game:GetService("Teams")[v]:remove() end)
- end
- end,
- kill = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() v.Character:BreakJoints() end)
- end
- end,
- kick = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() if IsIn(PermaAdmins,v.Name:lower()) then return end v:remove() end)
- end
- end,
- ban = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function()
- if IsIn(PermaAdmins,v.Name:lower()) then return end
- if not IsIn(PermaAdmins,P.Name:lower()) and IsIn(Admins,v.Name:lower()) then return end
- table.insert(ban,v.Name:lower())
- v:lower()
- end)
- end
- end,
- unban = function(p,P)
- newlist = {}
- for j, v in pairs(Ban) do
- pcall(function() if v:sub(1,#p[1]):lower() ~= v:lower() then table.insert(newlist,v) end end)
- end
- Ban = newlist
- end,
- ff = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() local I = Instance.new("ForceField") I.Parent = v.Character I.Name = "CommandsForceField" end)
- end
- end,
- unff = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() for m,n in pairs(v.Character:GetChildren()) do if n:IsA("ForceField") then n:remove() end end end)
- end
- end,
- loopkill = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() table.insert(Loopkill,v.Name:lower()) end)
- end
- end,
- unloopkill = function(p,P)
- newlist = {}
- for j, v in pairs(Loopkill) do
- for m, n in pairs(CheckPerson(P,p[1])) do
- pcall(function() if n:lower() ~= v:lower() then table.insert(newlist,v) end end)
- end
- end
- Loopkill = newlist
- end,
- admin= function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() table.insert(Admins,v.Name:lower()) end)
- end
- end,
- permaadmin= function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() table.insert(PermaAdmins,v.Name:lower()) end)
- end
- end,
- unadmin = function(p,P)
- newlist = {}
- for j, v in pairs(Admins) do
- for m, n in pairs(CheckPerson(P,p[1])) do
- pcall(function() if n:lower() ~= v:lower() then table.insert(newlist,v) end end)
- end
- end
- Loopkill = newlist
- end,
- explode = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() local I = Instance.new("Explosion") I.Parent = v.Character I.Position = v.Character.Torso.Position end)
- end
- end,
- rocket = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- local I = nil
- pcall(function() I = Instance.new("Part") I.Size = Vector3.new(1,8,1) I.TopSurface = "Inlet" local i = Instance.new("Weld") i.Part0 = v.Character.Torso i.Part1 = I i.C0 = CFrame.new(0,0,1) I.Parent = v.Character i.Parent = I local J = Instance.new("BodyForce") J.force = Vector3.new(0,7000,0) J.Parent = I end)
- if I ~= nil then
- Delay(6,function() local i = Instance.new("Explosion",Workspace) i.Position = I.Position I:remove() end)
- end
- end
- end,
- punish = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() v.Character.Parent = game.Lighting end)
- end
- end,
- unpunish = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() v.Character.Parent = Workspace v.Character:MakeJoints() v.Character.Animate.Disabled = true v.Character.Animate.Disabled = false end)
- end
- end,
- sit = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() v.Character.Humanoid.Sit = true end)
- end
- end,
- jump = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() v.Character.Humanoid.Jump = true end)
- end
- end,
- stand = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() v.Character.Humanoid.PlatformStand = true end)
- end
- end,
- sparkle = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() local I = Instance.new("Sparkles") I.Parent = v.Character.Torso I.Name = "CommandsSparkle" end)
- end
- end,
- unsparkle = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() for m,n in pairs(v.Character.Torso:GetChildren()) do if n:IsA("Sparkles") then n:remove() end end end)
- end
- end,
- flame = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() local I = Instance.new("Fire") I.Parent = v.Character.Torso I.Name = "CommandsSparkle" end)
- end
- end,
- unflame = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() for m, n in pairs(v.Character.Torso:GetChildren()) do if n:IsA("Fire") then n:remove() end end end)
- end
- end,
- extinguish = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() for m, n in pairs(v.Character.Torso:GetChildren()) do if n:IsA("Fire") or n:IsA("Smoke") or n:IsA("Sparkles") then n:remove() end end end)
- end
- end,
- smoke = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() local I = Instance.new("Smoke",v.Character.Torso) I.Name = "CommandsSparkle" end)
- end
- end,
- unsmoke = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() for m, n in pairs(v.Character.Torso:GetChildren()) do if n:IsA("Smoke") then n:removre() end end end)
- end
- end,
- invisible = function(p,P)
- for m,n in pairs(CheckPerson(P,p[1])) do
- pcall(function()
- for j, v in pairs(getAll(n.Character)) do
- if v:IsA("BasePart") then
- v.Transparency = 1
- end
- end
- end)
- end
- end,
- visible = function(p,P)
- for m,n in pairs(CheckPerson(P,p[1])) do
- pcall(function()
- for j, v in pairs(getAll(n.Character)) do
- if v:IsA("BasePart") then
- v.Transparency = 0
- end
- end
- end)
- end
- end,
- heal = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() v.Character.Humanoid.Health = v.Character.Humanoid.MaxHealth end)
- end
- end,
- damage = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() v.Character.Humanoid.Health = v.Character.Humanoid.Health-tonumber(p[2]) end)
- end
- end,
- health = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() v.Character.Humanoid.MaxHealth = p[2] v.Character.Humanoid.Health = v.Character.Humanoid.MaxHealth end)
- end
- end,
- removetools = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() for m,n in pairs(v.Backpack:GetChildren()) do n:remove() end for m,n in pairs(v.Character:GetChildren()) do if n:IsA("Tool") or n:IsA("HopperBin") then n:remove() end end end)
- end
- end,
- givetools = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() for m, n in pairs(game.StarterPack:GetChildren()) do n:clone().Parent = v.Backpack end end)
- end
- end,
- part = function(p,P)
- pcall(function() local I = Instance.new("Part") I.Name = "CommandsPart" I.Size = Vector3.new(tonumber(p[1]),tonumber(p[2]),tonumber(p[3])) I.Parent = Workspace I.Position = P.Character.Torso.Position+Vector3.new(0,5+(p[2]/2),0) end)
- end,
- respawn = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() local I = Instance.new("Part") I.Anchored = true I.CanCollide = false I.Transparency = 1 I.Position = Vector3.new(0,0,0) I.Name = "Head" local i = Instance.new("Model") I.Parent = i local II = Instance.new("Humanoid") II.Health = 0 II.Parent = i i.Parent = Workspace v.Character = i end)
- end
- end,
- merge = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() v.Character = CheckPerson(P,p[2])[1].Character end)
- end
- end,
- teleport = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() v.Character.Torso.CFrame = CheckPerson(P,p[2])[1].Character.Torso.CFrame end)
- end
- end,
- control = function(p,P)
- pcall(function() P.Character = CheckPerson(P,p[1])[1].Character end)
- end,
- change = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() for j, v in pairs(v.leaderstats:GetChildren()) do if v.Name:lower():sub(1,#p[2]) == p[2]:lower() then v.Value = tonumber(p[3]) end end end)
- end
- end,
- give = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() for m, I in pairs(game.Lighting:GetChildren()) do if I:IsA("Tool") or I:IsA("Hopperbin") then if p[2]:lower() == "all" or I.Name:lower():sub(1,#p[2]) == p[2]:lower() then I:clone().Parent = v.Backpack end end end end)
- end
- end,
- time = function(p,P)
- if not p[2] then p[2] = "0" p[3] = "0" elseif not p[3] then p[3] = "0" end
- pcall(function() game.Lighting.TimeOfDay = p[1]..":"..p[2]..":"..p[3] end)
- end,
- ambient = function(p,P)
- if not p[2] then p[2] = "0" p[3] = "0" elseif not p[3] then p[3] = "0" end
- pcall(function() game.Lighting.Ambient = Color3.new(tonumber(p[1])*(1/255),tonumber(p[2])*(1/255),tonumber(p[3])*(1/225)) end)
- end,
- brightness = function(p,P)
- pcall(function() game:Getservice("Lighting").Brightness = tonumber(p[1]) end)
- end,
- maxplayers = function(p,P)
- pcall(function() game.Players.MaxPlayers = tonumber(p[1]) end)
- end,
- antigrav = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() local I = Instance.new("BodyForce") I.force = Vector3.new(0,3000,0) I.Parent = v.Character.Torso end)
- end
- end,
- grav = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() for m, n in pairs(v.Character.Torso:GetChildren()) do if n:IsA("BodyForce") then n:remove() end end end)
- end
- end,
- setgrav = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() local I = Instance.new("BodyForce") I.force = Vector3.new(0,tonumber(p[2]),0) I.Parent = v.Character.Torso end)
- end
- end,
- trip = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() v.Character.Torso.CFrame = v.Character.Torso.CFrame*CFrame.Angles(math.pi,0,0) end)
- end
- end,
- walkspeed = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() v.Character.Humanoid.WalkSpeed = tonumber(p[2]) end)
- end
- end,
- freeze = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() for m,n in pairs(getAll(v.Character)) do if n:IsA("BasePart") then n.Anchored = true end end end)
- end
- end,
- thaw = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() for m,n in pairs(getAll(v.Character)) do if n:IsA("BasePart") then n.Anchored = false end end end)
- end
- end,
- unlock = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() for m,n in pairs(getAll(v.Character)) do if n:IsA("BasePart") then n.Locked = false end end end)
- end
- end,
- lock = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() for m,n in pairs(getAll(v.Character)) do if n:IsA("BasePart") then n.Locked = true end end end)
- end
- end,
- ["nil"] = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() v.Character = nil end)
- end
- end,
- null = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() v.Character = nil end)
- end
- end,
- m = function(p,P)
- pcall(function() local I = Instance.new("Message") I.Parent = Workspace I.Text = p[1] game.Debris:AddItem(I,5) end)
- end,
- c = function(p,P)
- pcall(function()
- local STR = ""
- for j, v in pairs(p) do
- STR = STR..v.."/"
- end
- --STR = STR:sub(1,#STR-1)
- STR = STR:sub(1,#STR-1)
- local I = script.CScr:clone()
- I.MySource.Value = STR
- I.Disabled = false
- I.Parent = Workspace
- table.insert(Scripts,I)
- end)
- end,
- clear = function(p,P)
- for j, v in pairs(Scripts) do
- pcall(function() v.Disabled = true v:remove() end)
- end
- Scripts = {}
- end,
- }
- --[[ = function(p,P)
- for j, v in pairs(CheckPerson(P,p[1])) do
- pcall(function() l end)
- end
- end,]]
- getAll = function(Place)
- local T = {}
- for j, v in pairs(Place:GetChildren()) do
- table.insert(T,v)
- for m, n in pairs(getAll(v)) do
- table.insert(T,n)
- end
- end
- return T
- end
- for j, v in pairs(PermaAdmins) do
- PermaAdmins[j] = v:lower()
- end
- for j, v in pairs(Ban) do
- Ban[j] = v:lower()
- end
- for j, v in pairs(AdminedRestrictions) do
- AdminedRestrictions[j] = v:lower()
- end
- GetBan = function(T,P)
- for j, v in pairs(T) do
- if tostring(v):lower():sub(1,#P) == P:lower() then
- return j
- end
- end
- end
- GetCmd = function(T,P)
- for j, v in pairs(T) do
- if tostring(j):lower() == P:lower() then
- return v
- end
- end
- end
- GetPlyr = function(N)
- local N = N:lower()
- Possible = {}
- for j ,v in pairs(game.Players:GetPlayers()) do
- if v.Name:lower():sub(1,#N) == N then
- table.insert(Possible,v)
- end
- end
- return Possible
- end
- GetIn = function(SString,S)
- local SString = SString..S
- local NumAmount = 0
- for k = 1, #SString do
- if SString:sub(k,k) == S then
- NumAmount = NumAmount+1
- end
- end
- local Pieces = {}
- local Last = 0
- for k = 1, NumAmount do
- local String2 = ""
- local Num2, _ = string.find(SString:sub(Last+1),S)
- Num2 = Num2+Last
- local Num1 = Last
- String2 = SString:sub(Num1+1,Num2-1)
- table.insert(Pieces,String2)
- Last = Num2
- end
- return Pieces
- end
- IsIn = function(List, Human)
- local j = 0
- for _,v in pairs(List) do
- if List ~= Admins and List ~= PermaAdmins and Human == v then
- return true
- elseif Human:lower() == v:lower() then
- return true
- end
- end
- return false
- end
- CheckPerson = function(p,c)
- print(c)
- print(type(c))
- local PersonP = {}
- if c == "me" then
- PersonP = {p}
- elseif c == "others" then
- local Tble = {}
- for j, v in pairs(game.Players:GetPlayers()) do
- if v ~= p then
- table.insert(Tble,v)
- end
- end
- PersonP = Tble
- elseif c == "all" then
- PersonP = game.Players:GetPlayers()
- elseif c == "random" then
- PersonP = {game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())]}
- elseif string.sub(c,1,5) == "team " then
- local Tble = {}
- for j, v in pairs(game.Players:GetChildren()) do
- if tostring(v.TeamColor):lower() == c:sub(6) then
- table.insert(Tble,v)
- end
- end
- PersonP = Tble
- elseif c == "nonadmins" then
- local Tble = {}
- for j, v in pairs(game.Players:GetPlayers()) do
- if IsIn(Admins,v.Name:lower()) == false then
- table.insert(Tble,v)
- end
- end
- PersonP = Tble
- elseif c == "admins" then
- local Tble = {}
- for j, v in pairs(game.Players:GetPlayers()) do
- if IsIn(Admins,v.Name:lower()) then
- table.insert(Tble,v)
- end
- end
- PersonP = Tble
- elseif not c:find(":") then
- local Tble = {}
- for j, v in pairs(GetPlyr(c)) do
- table.insert(Tble,v)
- end
- PersonP = Tble
- else
- local Tble = {}
- for j, v in pairs(GetIn(c,":")) do
- pcall(function()
- local I = CheckPerson(p,v)
- for m, n in pairs(I) do
- table.insert(Tble,n)
- end
- end)
- end
- PersonP = Tble
- end
- local RemoveP = {}
- local DLT = GetIn(c,"-")
- if DLT[2] then
- for k = 2, #DLT do
- print(DLT[k])
- print(type(DLT[k]))
- for j, v in pairs(CheckPerson(p,DLT[k])) do
- table.insert(RemoveP,v)
- end
- end
- end
- local Fix = {}
- for j, v in pairs(PersonP) do
- if not IsIn(RemoveP,v) then
- table.insert(Fix,v)
- end
- end
- --[[local Fix = {}
- for j, v in pairs(PersonP) do
- table.inser
- end]]
- return Fix
- end
- Chatted = function(p)
- local Connection = p.Chatted:connect(function(m)
- print(p.Name.." Chatted")
- if not IsIn(PermaAdmins,p.Name:lower()) and not IsIn(Admins,p.Name:lower()) then return end
- print("IsAdmin")
- RunCommands = GetIn(m,"\\")
- do
- local C = {}
- if IsIn(FrontZ,RunCommands[1]) then
- print("StarterZ:",RunCommands[1])
- if not RunCommands[2] then print("No Arguments") return end
- for k = 2, #RunCommands do
- C[k-1] = RunCommands[k]
- end
- RunCommands = C
- end
- end
- for j, v in pairs(RunCommands) do
- print("Command Running Number: ",j," -- ",v)
- local Send = GetIn(v,"/")
- local Arguments = {}
- if Send[2] then
- for k = 2, #Send do
- Arguments[k-1] = Send[k]
- end
- else
- Arguments[1] = ""
- end
- print(Send[1]:lower())
- print("Is A Command: ",GetCmd(Commands,Send[1]:lower()))
- if GetCmd(Commands,Send[1]:lower()) then
- if not IsIn(AdminedRestrictions,Send[1]:lower()) or IsIn(PermaAdmins,p.Name:lower()) then
- GetCmd(Commands,Send[1]:lower())(Arguments,p)
- end
- end
- end
- end)
- repeat wait() until not Connection.connected
- local I = Instance.new("Message",Workspace)
- I.Name = "ErroredAdmin"
- I.Text = "Cy's Administration Script: Admin errored on "..p:GetFullName()..". Making new event connection."
- game:GetService("Debris"):AddItem(I,5)
- Chatted(p)
- end
- for j, p in pairs(game.Players:GetChildren()) do
- Spawn(function()
- for j, v in pairs(AdminItemId) do
- if (v and type(v):lower() == "number" and game:GetService("BadgeService"):UserHasBadge(p.userId,v)) then table.insert(Admins,p.Name:lower()) end
- end
- Chatted(p)
- if IsIn(Ban,p.Name:lower()) then
- p:remove()
- end
- end)
- end
- game.Players.PlayerAdded:connect(function(p)
- for j, v in pairs(AdminItemId) do
- if (v and type(v):lower() == "number" and game:GetService("BadgeService"):UserHasBadge(p.userId,v)) then table.insert(Admins,p.Name:lower()) end
- end
- Chatted(p)
- if IsIn(Ban,p.Name:lower()) then p:remove() end
- end)
- while true do
- for j, v in pairs(Loopkill) do
- pcall(function() game.Players[v].Character:BreakJoints() j.Character.Humanoid.Health = 0 end)
- end
- wait()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement