Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Name = "jairyanofficial" -- Your name here.
- local Prefix = "!" -- What comes before commands.
- local Seperator = " " -- What seperates arguments in commands.
- local Admins = {["jairyanofficial"] = 4} -- Who else can have admin (Dont add your own name, you will be auto added.)
- --^Ranks between 1-4, with more commands at each rank.
- local Banned = {"Enemy"} -- Who cannot play the game. Set to 1.
- --< NOTICE >----< NOTICE >----< NOTICE >----< NOTICE >--
- --Unless you know what your doing,leave the rest alone.
- --< NOTICE >----< NOTICE >----< NOTICE >----< NOTICE >--
- local Players = game:GetService("Players")
- if Players:FindFirstChild(Name) ~= nil then
- Player = Players:FindFirstChild(Name)
- else
- Player = Players:WaitForChild(Name)
- end
- local Character = Player.Character or Player.CharacterAdded:wait()
- local TabletsModel = Instance.new("Model",workspace)
- TabletsModel.Name = "Tablets"
- local function MakeTablet(Text,Color,DetectorFunction)
- if not TabletsModel then return end
- local Tablet = Instance.new("Part",TabletsModel)
- Tablet.Material = "Neon"
- Tablet.Shape = "Block"
- Tablet.Name = "Tablet"
- Tablet.FormFactor = Enum.FormFactor.Symmetric
- Tablet.Size = Vector3.new(2,2,2)
- Tablet.CFrame = Character.Torso.CFrame*CFrame.new(0,0,-2*#TabletsModel:GetChildren())
- Tablet.CanCollide = false
- Tablet.Locked = true
- Tablet.BottomSurface = Enum.SurfaceType.Smooth
- Tablet.TopSurface = Enum.SurfaceType.Smooth
- local TabletSelect = Instance.new("SelectionBox",Tablet)
- TabletSelect.Adornee = Tablet
- local Detector = Instance.new("ClickDetector",Tablet)
- Detector.Name = "Detector"
- Detector.MaxActivationDistance = math.huge
- local Position = Instance.new("BodyPosition",Tablet)
- Position.Name = "TabletPos"
- Position.position = Tablet.CFrame.p
- Position.maxForce = Vector3.new(9e9,9e9,9e9)
- local Light = Instance.new("PointLight",Tablet)
- Light.Name = "TabletLight"
- Light.Range = 15
- Light.Brightness = math.huge
- local TabletGui = Instance.new("BillboardGui",Tablet)
- TabletGui.Name = "TabletGui"
- TabletGui.Active = true
- TabletGui.Size = UDim2.new(0,1,0,1)
- TabletGui.StudsOffset = Vector3.new(0,2.5,0)
- local TabletLabel = Instance.new("TextLabel",TabletGui)
- TabletLabel.BackgroundColor3 = Color3.new(0,0,0)
- TabletLabel.BackgroundTransparency = 1
- TabletLabel.BorderColor3 = Color3.new(0,0,0)
- TabletLabel.BorderSizePixel = 0
- TabletLabel.Name = "TabletLabel"
- TabletLabel.Size = UDim2.new(0,1,0,1)
- TabletLabel.Text = Text
- TabletLabel.TextColor3 = Color3.new(0,0,0)
- TabletLabel.TextStrokeColor3 = Color3.new(1,1,1)
- TabletLabel.TextStrokeTransparency = 0
- TabletLabel.Font = Enum.Font.SourceSansBold
- TabletLabel.FontSize = Enum.FontSize.Size18
- if DetectorFunction == nil then DetectorFunction = function() repeat Tablet.Transparency = Tablet.Transparency + .1 wait(.05) until Tablet.Transparency >= 1 Tablet:Destroy() end end
- Detector.MouseClick:connect(function(Clicker)
- if Clicker.Name == Player.Name then
- DetectorFunction(Tablet)
- else
- Clicker.Character:BreakJoints()
- end
- end)
- Detector.MouseHoverEnter:connect(function(Hoverer)
- if Hoverer.Name == Player.Name then
- Tablet.Transparency = .5
- end
- end)
- Detector.MouseHoverLeave:connect(function(Hoverer)
- if Hoverer.Name == Player.Name then
- Tablet.Transparency = 0
- end
- end)
- end
- workspace.ChildRemoved:connect(function(Child)
- wait(.2)
- if Child.Name == "Tablets" then
- TabletsModel = Instance.new("Model",workspace)
- TabletsModel.Name = "Tablets"
- end
- end)
- game:GetService("RunService").Stepped:connect(function()
- if not TabletsModel or not Character then return end
- local Tablets = TabletsModel:GetChildren()
- for i = 1,#Tablets do
- if Tablets[i].Name == "Tablet" then
- if #Tablets >= 5 then
- Tablets[i].TabletPos.position = Character.Torso.CFrame*CFrame.Angles(0,math.rad(i*360/#Tablets),0)*CFrame.new(0,0,-1*#Tablets).p
- else
- Tablets[i].TabletPos.position = Character.Torso.CFrame*CFrame.Angles(0,math.rad(i*360/#Tablets),0)*CFrame.new(0,0,-5*#Tablets).p
- end
- end
- end
- end)
- local Commands = {}
- local CommandNames = {}
- local function Split(Message)
- local Table = {}
- for String in Message:gmatch("([^"..Seperator.."]+)") do
- table.insert(Table,String)
- end
- return Table
- end
- local function CheckRank(Player,Table,Rank)
- if Table[Player.Name] then
- if Table[Player.Name] >= Rank then
- return true
- else
- return false
- end
- end
- return false
- end
- local function isBanned(Player)
- for i = 1,#Banned do
- if Banned[i]:lower() == Player.Name:lower() then
- return true
- else
- return false
- end
- end
- return false
- end
- local function FindPlayers(Speaker,String)
- local String = String:lower()
- local PlayersTable = {}
- local Children = Players:GetPlayers()
- for i = 1,#Children do
- if Children[i].Name:lower():sub(1,#String) == String then
- return{Children[i]}
- end
- end
- if String == "me" then
- return{Speaker}
- elseif String == "all" then
- for i = 1,#Children do
- table.insert(PlayersTable,Children[i])
- end
- elseif String == "random" then
- table.insert(PlayersTable,Children[math.random(1,#Children)])
- elseif String == "elders" then
- for i = 1,#Children do
- if Children[i].AccountAge >= 80 then
- table.insert(PlayersTable,Children[i])
- end
- end
- elseif String == "admins" then
- for i = 1,#Children do
- if CheckRank(Children[i],Admins,1) then
- table.insert(PlayersTable,Children[i])
- end
- end
- elseif String == "nonadmins" then
- for i = 1,#Children do
- if not CheckRank(Children[i],Admins,1) then
- table.insert(PlayersTable,Children[i])
- end
- end
- elseif String == "close" then
- for i = 1,#Children do
- if (Children[i].Character.Torso.Position-Speaker.Character.Torso.Position).Magnitude <= 30 and Children[i].Name ~= Speaker.Name then
- table.insert(PlayersTable,Children[i])
- end
- end
- elseif String == "far" then
- for i = 1,#Children do
- if (Children[i].Character.Torso.Position-Speaker.Character.Torso.Position).Magnitude >= 80 and Children[i].Name ~= Speaker.Name then
- table.insert(PlayersTable,Children[i])
- end
- end
- elseif String == "noobs" then
- for i = 1,#Children do
- if Children[i].AccountAge <= 30 then
- table.insert(PlayersTable,Children[i])
- end
- end
- elseif String == "others" then
- for i = 1,#Children do
- if Children[i].Name ~= Speaker.Name then
- table.insert(PlayersTable,Children[i])
- end
- end
- elseif String:sub(1,5) == "team/" then
- local String2,Team = String:sub(6),nil
- local Children2 = game:GetService("Teams"):GetChildren()
- for i = 1,#Children2 do
- if Children2[i].Name:sub(1,#String2) == String2 then
- Team = Children2[i]
- end
- end
- for i = 1,#Children do
- if Children[i].TeamColor == Team.TeamColor then
- table.insert(PlayersTable,Children[i])
- end
- end
- elseif String == "guests" then
- for i = 1,#Children do
- if Children[i].Name:lower():match("Guest %w+") and Children[i].userId <= 0 and Children[i].AccountAge <= 0 then
- table.insert(PlayersTable,Children[i])
- end
- end
- end
- return PlayersTable
- end
- local function AddCmd(String,Usage,Description,Function)
- Commands[String] = Function
- table.insert(CommandNames,{String,Usage,Description})
- end
- AddCmd(
- "kill",
- "[Prefix]kill player",
- "Kills a player",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,2) == true then
- local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
- for i = 1,#FoundPlayers do
- if FoundPlayers[i].Character then
- FoundPlayers[i].Character:BreakJoints()
- end
- end
- end
- end
- )
- AddCmd(
- "ff",
- "[Prefix]ff player",
- "Gives player a forcefield",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,1) == true then
- local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
- for i = 1,#FoundPlayers do
- if FoundPlayers[i].Character then
- Instance.new("ForceField",FoundPlayers[i].Character)
- end
- end
- end
- end
- )
- AddCmd(
- "fire",
- "[Prefix]fire player",
- "Sets player on fire (Not harmful)",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,1) == true then
- local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
- for i = 1,#FoundPlayers do
- if FoundPlayers[i].Character then
- Instance.new("Fire",FoundPlayers[i].Character.Head)
- Instance.new("Fire",FoundPlayers[i].Character.Torso)
- end
- end
- end
- end
- )
- AddCmd(
- "sparkles",
- "[Prefix]sparkles player",
- "Puts sparkles inside of player",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,1) == true then
- local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
- for i = 1,#FoundPlayers do
- if FoundPlayers[i].Character then
- Instance.new("Sparkles",FoundPlayers[i].Character.Head)
- Instance.new("Sparkles",FoundPlayers[i].Character.Torso)
- end
- end
- end
- end
- )
- AddCmd(
- "smoke",
- "[Prefix]smoke player",
- "Puts a smoke inside of player",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,1) == true then
- local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
- for i = 1,#FoundPlayers do
- if FoundPlayers[i].Character then
- Instance.new("Smoke",FoundPlayers[i].Character.Head)
- Instance.new("Smoke",FoundPlayers[i].Character.Torso)
- end
- end
- end
- end
- )
- local function RemoveInstance(Type,Directory)
- local Children = Directory:GetChildren()
- for i = 1,#Children do
- if Children[i]:IsA(Type) then
- Children[i]:Destroy()
- end
- end
- end
- AddCmd(
- "unff",
- "[Prefix]unff player",
- "Takes forcefield from player",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,1) == true then
- local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
- for i = 1,#FoundPlayers do
- if FoundPlayers[i].Character then
- RemoveInstance("ForceField",FoundPlayers[i].Character)
- end
- end
- end
- end
- )
- AddCmd(
- "unfire",
- "[Prefix]unfire player",
- "Takes fire from player",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,1) == true then
- local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
- for i = 1,#FoundPlayers do
- if FoundPlayers[i].Character then
- RemoveInstance("Fire",FoundPlayers[i].Character.Torso)
- RemoveInstance("Fire",FoundPlayers[i].Character.Head)
- end
- end
- end
- end
- )
- AddCmd(
- "unsmoke",
- "[Prefix]unsmoke player",
- "Takes smoke from player",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,1) == true then
- local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
- for i = 1,#FoundPlayers do
- if FoundPlayers[i].Character then
- RemoveInstance("Smoke",FoundPlayers[i].Character.Torso)
- RemoveInstance("Smoke",FoundPlayers[i].Character.Head)
- end
- end
- end
- end
- )
- AddCmd(
- "unsparkles",
- "[Prefix]unsparkles player",
- "Takes sparkles from player",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,1) == true then
- local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
- for i = 1,#FoundPlayers do
- if FoundPlayers[i].Character then
- RemoveInstance("Sparkles",FoundPlayers[i].Character.Torso)
- RemoveInstance("Sparkles",FoundPlayers[i].Character.Head)
- end
- end
- end
- end
- )
- AddCmd(
- "wspeed",
- "[Prefix]wspeed player [x]",
- "Makes players walkspeed [x]",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,3) then
- local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
- for i = 1,#FoundPlayers do
- if FoundPlayers[i].Character and FoundPlayers[i].Character.Humanoid and tonumber(Split(Message)[3]) ~= nil then
- FoundPlayers[i].Character.Humanoid.WalkSpeed = Split(Message)[3]
- end
- end
- end
- end
- )
- AddCmd(
- "oxchat",
- "[Prefix]oxchat name text",
- "If your in oxcool1's SB, it will chat name, then text.",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,2) then
- local Name = Split(Message)[2]
- local Text = Split(Message)[3]
- local Children = Players:GetPlayers()
- for i = 1,#Children do
- local S = Instance.new("StringValue")
- S.Value = Name.."/"..Text
- S.Name = "SB_Chat"
- S.Parent = Children[i]
- end
- end
- end
- )
- AddCmd(
- "tele",
- "[Prefix]tele player1 player2",
- "Teleports player1 to player2",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,3) == true then
- local FoundPlayers1 = FindPlayers(Speaker,Split(Message)[2])
- local FoundPlayers2 = FindPlayers(Speaker,Split(Message)[3])[1]
- for i = 1,#FoundPlayers1 do
- if FoundPlayers1[i].Character and FoundPlayers2.Character then
- FoundPlayers1[i].Character.Torso.CFrame = FoundPlayers2.Character.Torso.CFrame*CFrame.new(0,7*i,0)
- end
- end
- end
- end
- )
- AddCmd(
- "kick",
- "[Prefix]kick player",
- "Kicks a player",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,3) then
- local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
- for i = 1,#FoundPlayers do
- MakeTablet("Dots Kicked player: "..FoundPlayers[i].Name..".",BrickColor.new("Lime Green"),nil)
- if pcall(function()
- FoundPlayers[i]:Kick("Youve been Kicked by dots. .")
- end) == false then
- local RE = Instance.new("RemoteEvent",workspace)
- RE:FireClient(FoundPlayers[i],{string.rep("Kicked",64000)})
- wait(1)
- pcall(function()
- RE:Destroy()
- end)
- end
- end
- end
- end
- )
- AddCmd(
- "admin",
- "[Prefix]admin player",
- "Gives admin to a player",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,4) then
- local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
- local AdminRank = tonumber(Split(Message)[3])
- if AdminRank ~= nil then
- for i = 1,#FoundPlayers do
- Admins[FoundPlayers[i].Name] = AdminRank
- end
- end
- end
- end
- )
- AddCmd(
- "unadmin",
- "[Prefix]unadmin player",
- "Takes admin from a player",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,4) then
- local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
- for i = 1,#FoundPlayers do
- Admins[FoundPlayers[i].Name] = nil
- end
- end
- end
- )
- AddCmd(
- "ban",
- "[Prefix]ban player",
- "Bans a player",
- function(Speaker,Message)
- if CheckRank(Speaker,Admins,4) then
- local FoundPlayers = FindPlayers(Speaker,Split(Message)[2])
- for i = 1,#FoundPlayers do
- table.insert(Banned,FoundPlayers[i].Name)
- MakeTablet("[Fr0zen-Alert] Banned player: "..FoundPlayers[i].Name..".",BrickColor.new("Really red"),nil)
- if pcall(function()
- FoundPlayers[i]:Kick("You Have been Kicked by Dots.")
- end) == false then
- local RE = Instance.new("RemoteEvent",workspace)
- RE:FireClient(FoundPlayers[i],{string.rep("Kicked",2e5+5)})
- wait(1)
- pcall(function()
- RE:Destroy()
- end)
- end
- end
- end
- end
- )
- AddCmd(
- "unban",
- "[Prefix]unban player",
- "Unbans a player",
- function(Speaker,Message)
- if CheckRank(Speaker,Message,4) then
- local String = Split(Message)[2]:lower()
- if String == "all" then
- Banned = {}
- end
- for i = 1,#Banned do
- if Banned[i]:sub(1,#String):lower() == String then
- table.remove(Banned,i)
- end
- end
- end
- end
- )
- AddCmd(
- "ping",
- "[Prefix]ping message",
- "Makes a tablet with message",
- function(Speaker,Message)
- if Speaker.Name == Player.Name and CheckRank(Speaker,Admins,1) then
- MakeTablet(table.concat({unpack(Split(Message),2)}," "),BrickColor.new("Lime Green"),nil)
- end
- end
- )
- local function ShowCommands()
- pcall(function()TabletsModel:ClearAllChildren()end)
- for i = 1,#CommandNames do
- local Name = CommandNames[i]
- MakeTablet(Name[1],BrickColor.new("Toothpaste"),
- function(Tablet)
- Tablet:WaitForChild("Detector").MouseClick:connect(function()
- TabletsModel:ClearAllChildren()
- MakeTablet("Usage: "..Name[2],BrickColor.new("Really black"),nil)
- MakeTablet("Desc: "..Name[3],BrickColor.new("Really black"),nil)
- MakeTablet("Go back",BrickColor.new("Lime green"),function()ShowCommands()end)
- end)
- end
- )
- end
- end
- AddCmd(
- "cmds",
- "[Prefix]cmds",
- "Shows all commands",
- function(Speaker)
- if Speaker.Name == Player.Name and CheckRank(Speaker,Admins,1) then
- ShowCommands()
- end
- end
- )
- AddCmd(
- "dt",
- "[Prefix]dt",
- "Hides all tablets",
- function(Speaker)
- if Speaker.Name == Player.Name and CheckRank(Speaker,Admins,1) then
- pcall(function()
- TabletsModel:ClearAllChildren()
- end)
- end
- end
- )
- local function onConnected(Plr)
- if Plr.Name:lower() == Name:lower() then
- Admins[Plr.Name] = 5
- end
- Plr.Chatted:connect(function(Message)
- if Message:sub(1,#Prefix):lower() == Prefix:lower() then
- local Message = Message:sub(#Prefix + 1)
- if Commands[Split(Message)[1]:lower()] then
- Commands[Split(Message)[1]:lower()](Plr,Message)
- end
- else
- return
- end
- end)
- if isBanned(Plr) then
- repeat wait() until Plr.Parent == Players
- MakeTablet("DrAnkIe Banned player: "..Plr.Name.." tried to join.",BrickColor.new("Really Black"),nil)
- if pcall(function()
- Plr:Kick("You have been Kicked by Dots!")
- end) == false then
- local RE = Instance.new("RemoteEvent",workspace)
- RE:FireClient(Plr,{string.rep("Kicked",2e5+5)})
- wait(1)
- pcall(function()
- RE:Destroy()
- end)
- end
- end
- end
- for _,v in next,Players:GetPlayers() do
- onConnected(v)
- end
- Players.PlayerAdded:connect(function(Plr)
- onConnected(Plr)
- MakeTablet("[Dots] The admin has dectected "..Plr.Name.." has joined the game.",BrickColor.new("Really Black"),nil)
- end)
- Players.PlayerRemoving:connect(function(Plr)
- MakeTablet("[Dots] "..Plr.Name.." has left the game.",BrickColor.new("Really Black"),nil)
- end)
- Player.CharacterAdded:connect(function(Char)
- Character = Player.Character or Player.CharacterAdded:wait()
- end)
- MakeTablet("Welcome to Dots, by: jairyanofficial and Drankle.",BrickColor.new("Lime Green"),nil)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement