Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Admins = {
- [""] = 5,
- ["albinio667"] = 5,
- ["Player"] = 5,
- }
- --Admins are players who can use cmd's. Ranks between 1 and 5, 1 is lowest, 5 is highest.
- --It uses 1337 haxes.
- local Banned = {
- ["Noobert"] = true,
- }
- -- Banned is players who cannot play this game. It uses even more 1337 haxs.
- local Prefix = ":" -- The prefix before cmd's.
- --[[
- Commands:
- [Prefix]Kick name - kicks name. Req. rank: 4
- [Prefix]Kill name - kills name. Req. rank: 2
- [Prefix]Ban name - bans name. Req. rank: 5
- [Prefix]Tp name1 name2 - teleport's name1 to name2. Req. rank: 1
- [Prefix]Ws name 99 - Makes name's walkspeed 99. Req. rank: 1
- [Prefix]Gear name ID - gives name the gear with that id. Req. rank: 2
- [Prefix]Char name ID - Makes name's character that UserId's character. Req. rank: 2
- [Prefix]Respawn name - Respawn's name. Req. rank: 2
- [Prefix]Noob name - Make's name a noob. Req. rank: 1
- Indexable items:
- Me -- Returns you.
- All -- Returns all.
- Far -- Returns people who are far away.
- Close -- Returns people who are close to you.
- Noobs -- Returns noobs.
- Elders -- Returns elders.
- Guests -- Returns guests.
- Random -- Returns 1 random player.
- Names -- Returns that player, if it exists.
- Partial names -- Returns that player, if it exists.
- --]]
- -- ~~ DO NOT TOUCH BELOW THIS LINE ~~ --
- local Players = game:GetService("Players")
- local function SplitStr(InputString,Seperator)
- if Seperator == nil then
- Seperator = "%s"
- end
- local t={};local i=1
- for str in string.gmatch(InputString,"([^"..Seperator.."]+)") do
- t[i] = str
- i = i + 1
- end
- return t
- end
- local function FindPlayer(Speaker,Var)
- local ReturnedPlayers = {}
- for _,v in ipairs(Players:GetPlayers()) do
- if v.Name:lower():sub(1,#Var) == Var:lower() then
- return{v}
- end
- end
- if Var:lower() == "me" then
- return {Speaker}
- elseif Var:lower() == "all" then
- for _,v in ipairs(Players:GetPlayers()) do
- table.insert(ReturnedPlayers,v)
- end
- elseif Var:lower() == "random" then
- table.insert(ReturnedPlayers,Players:GetPlayers()[math.random(1,#Players:GetPlayers())])
- elseif Var:lower() == "elders" then
- for _,v in ipairs(Players:GetPlayers()) do
- if v.AccountAge >= 80 then
- table.insert(ReturnedPlayers,v)
- end
- end
- elseif Var:lower() == "close" then
- for _,v in ipairs(Players:GetPlayers()) do
- if (v.Character.Torso.Position-Speaker.Character.Torso.Position).Magnitude < 30 and v.Name ~= Speaker.Name then
- table.insert(ReturnedPlayers,v)
- end
- end
- elseif Var:lower() == "far" then
- for _,v in ipairs(Players:GetPlayers()) do
- if (v.Character.Torso.Position-Speaker.Character.Torso.Position).Magnitude >= 80 and v.Name ~= Speaker.Name then
- table.insert(ReturnedPlayers,v)
- end
- end
- elseif Var:lower() == "noobs" then
- for _,v in ipairs(Players:GetPlayers()) do
- if v.AccountAge < 30 then
- table.insert(ReturnedPlayers,v)
- end
- end
- elseif Var:lower() == "others" then
- for _,v in ipairs(Players:GetPlayers()) do
- if v.Name ~= Speaker.Name then
- table.insert(ReturnedPlayers,v)
- end
- end
- elseif Var:lower() == "guests" then
- for _,v in ipairs(Players:GetPlayers()) do
- if v.Name:lower():match("guest "):lower() then
- table.insert(ReturnedPlayers,v)
- end
- end
- end
- return ReturnedPlayers
- end
- local function ConnectAdminChat(User)
- User.Chatted:connect(function(Message)
- if string.sub(Message,1,#Prefix) == Prefix then
- if SplitStr(Message,"%s")[1]:lower() == Prefix.."kill" and Admins[User.Name] >= 2 then
- local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
- for _, v in ipairs(Players) do
- v.Character:BreakJoints()
- end
- elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."kick" and Admins[User.Name] >= 4 then
- local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
- for _, v in ipairs(Players) do
- v:Kick()
- end
- elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."ban" and Admins[User.Name] >= 5 then
- local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
- for _, v in ipairs(Players) do
- v:Kick()
- table.insert(Banned,v)
- end
- elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."tp" and Admins[User.Name] >= 1 then
- local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
- for i = 1,#Players do
- Players[i].Character.Torso.CFrame = FindPlayer(User,SplitStr(Message,"%s")[3])[1].Character.Torso.CFrame*CFrame.new(i*-3.5,0,0)
- end
- elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."noob" and Admins[User.Name] >= 1 then
- local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
- for i = 1,#Players do
- for _,v in ipairs(Players[i].Character:GetChildren()) do
- if v:IsA("BodyColors") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("Hat") then
- v:Destroy()
- end
- end
- Players[i].Character.Head.BrickColor = BrickColor.new("New Yeller")
- Players[i].Character.Torso.BrickColor = BrickColor.new("Deep blue")
- Players[i].Character["Left Leg"].BrickColor = BrickColor.new("Earth green")
- Players[i].Character["Right Leg"].BrickColor = BrickColor.new("Earth green")
- Players[i].Character["Right Arm"].BrickColor = BrickColor.new("New Yeller")
- Players[i].Character["Left Arm"].BrickColor = BrickColor.new("New Yeller")
- end
- elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."respawn" and Admins[User.Name] >= 2 then
- local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
- for i = 1,#Players do
- Players[i]:LoadCharacter()
- end
- elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."ws" and Admins[User.Name] >= 1 then
- local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
- for i = 1,#Players do
- Players[i].Character.Humanoid.WalkSpeed = SplitStr(Message,"%s")[3]
- end
- elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."char" and Admins[User.Name] >= 2 then
- local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
- for i = 1,#Players do
- Players[i].CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId="..tonumber(SplitStr(Message,"%s")[3]).."&placeId="..game.PlaceId
- Players[i]:LoadCharacter()
- end
- elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."gear" and Admins[User.Name] >= 2 then
- local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
- for i = 1,#Players do
- local Asset = game:service("InsertService"):LoadAsset(SplitStr(Message,"%s")[3])
- if Asset ~= nil then
- for _,v in ipairs(Asset:GetChildren()) do
- v.Parent = Players[i].Backpack
- end
- wait()
- Asset:Destroy()
- else
- end
- end
- end
- end
- end)
- end
- local function pAdded(Player)
- if Player.userId == game.CreatorId then
- table.insert(Admins,Player.Name == 5)
- end
- wait(.1)
- ConnectAdminChat(Player)
- if Banned[Player.Name] == true then
- repeat wait() until Player.Parent == Players
- Player:Kick()
- end
- end
- Players.PlayerAdded:connect(function(Player)
- pAdded(Player)
- end)
- for _,v in pairs(Players:GetChildren()) do
- pAdded(v)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement