Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[BlackCodeAdmin Tabs]--
- wait()
- Commands = {}
- Player = game:GetService("Players").LocalPlayer --Local Admin
- Bet = "<"
- Tablets = {};
- print('BlackCode Admin')
- wait(.95)
- print ('Functions are loaded')
- script.Parent = nil
- Tablets = {}
- Rotation = 0
- RotationAddValue = 0.0004
- script.Name = "<>|BlackCode Admin|<>"
- Notify=true
- --Part/OutPut--
- function Tablet(Plr, Text, Color, onClicked,onTouched)
- pcall(function() local a = Color.r if type(a) == "number" then Color = a end end)
- pcall(function() local a = BrickColor.new(Color) if a then Color = a.Color end end)
- if not pcall(function() local a = Color.r if type(a) ~= "number" then error() end end) then
- Color = "White"
- end
- if Color == nil then Color='White' end
- if Plr.Character.Torso == nil then
- return
- end
- local Insert = {}
- local tab = Instance.new("Part", game:GetService("Workspace")) --Might Change To StarterPlayer or Lighting
- local light = Instance.new("PointLight", tab)
- light.Enabled = true
- light.Range = 15
- tab.Name = tostring(math.random(-99999,99999))
- tab.FormFactor = "Custom"
- tab.Size = Vector3.new(2.8, 2.8, 2.8)
- tab.Shape = "Ball"
- tab.Material = "Foil"
- tab.Anchored = true
- tab.Locked = true
- tab.CanCollide = false
- tab.Transparency = 0.3
- tab.Color = BrickColor.new(Color).Color
- tab.CFrame = Plr.Character.Torso.CFrame * CFrame.new(8,0,8)
- if onTouched~=nil then
- tab.Touched:connect(function(what)
- a,b=ypcall(function()
- onTouched(what)
- end)
- if not a then error(b) end
- end)
- end
- --[[local box = Instance.new("SelectionBox", tab) --With ball shape it doesnt look good
- box.Adornee = box.Parent
- box.Transparency = 0.5
- box.Color = BrickColor.new(Color)]]
- local gui = Instance.new("BillboardGui", tab)
- gui.Adornee = tab
- gui.StudsOffset = Vector3.new(0,tab.Size.Y+0.5,0)
- gui.Size = UDim2.new(1,0,1,0)
- local text = Instance.new("TextLabel", gui)
- text.BackgroundTransparency = 1
- text.Text = tostring(Text)
- text.Position = UDim2.new(0.5,0,0.5,0)
- text.Font = "ArialBold"
- text.FontSize = "Size18"
- text.TextColor3 = Color
- text.TextStrokeTransparency = 1
- local Click = Instance.new("ClickDetector", tab)
- Click.MaxActivationDistance = math.huge
- Click.MouseHoverEnter:connect(function(Player)
- if Player.Name == Plr.Name then
- tab.Transparency = 0.2
- tab.Size = Vector3.new(3.8,3.8,3.8)
- --box.Transparency = 0.2--Ball Shape Errors
- end
- end)
- Click.MouseHoverLeave:connect(function(Player)
- if Player.Name == Plr.Name then
- tab.Transparency = 0.5
- tab.Size = Vector3.new(2.8, 2.8, 2.8)
- --box.Transparency = 0.5--Ball Shape Errors
- end
- end)
- Click.MouseClick:connect(function(Player)
- if Player.Name == Plr.Name then
- if onClicked == nil then
- tab:Destroy()
- for i,v in pairs(Tablets) do
- if v.Part.Name == tab.Name and v.Holder.Name == Plr.Name then
- table.remove(Tablets, i)
- end
- end
- else
- local Run,Error = ypcall(function()
- onClicked()
- end)
- if Error then
- Tablet(Plr, tostring(Error), "Really red")
- end
- tab:Destroy()
- for i,v in pairs(Tablets) do
- if v.Part.Name == tab.Name and v.Holder.Name == Plr.Name then
- table.remove(Tablets, i)
- end
- end
- end
- end
- end)
- Insert.Holder = Plr
- Insert.Part = tab
- table.insert(Tablets, Insert)
- end
- ROT=function()
- game:GetService("RunService").Heartbeat:connect(function()
- pcall(function()
- for _,v in pairs(game:GetService("Players"):GetPlayers()) do
- if v.Character.Head then
- Rotation = Rotation + RotationAddValue
- --Rotation=0.0002
- local AllTabs = {}
- for _,tab in pairs(Tablets) do
- if tab.Holder.Name == v.Name then
- table.insert(AllTabs, tab)
- end
- end
- for i = 1, #AllTabs do
- pcall(function()
- local Position = v.Character.Head.CFrame.p
- local Radius = (#AllTabs * 0.5) + 5
- local M = (i / #AllTabs - (0.5 / #AllTabs) * Rotation * 2) * math.pi * (4/2)
- local X = math.sin(M) * Radius
- local Y = 0
- local Z = math.cos(M) * Radius
- local A = Vector3.new(X, Y, Z) + Position
- local B = AllTabs[i].Part.CFrame.p
- local C = A * 0.1 + B * 0.9
- AllTabs[i].Part.CFrame = CFrame.new(C, Position)
- end)
- end
- end
- end
- end)
- end)
- end
- ------------------------------ Get All Players OutPut
- function TabletAll(text, color)
- for i,v in pairs(game.Players:GetPlayers()) do
- Tablet(v, text, color)
- end
- end
- function LocalTablet(Text, Color, onClicked,onTouched)
- pcall(function() Tablet(game.Players.LocalPlayer,Text,Color,onClicked,onTouched) end)
- end
- ---------------------Join Output
- game.Players.ChildAdded:connect(function(plr)
- if (Notify == true) then
- LocalTablet("</BlackCode/>: "..plr.Name.." Has Connected To Server!", "Lime green")
- end
- end)
- --------------------- Main Functions and stuff
- function ShowMusicList()
- Dismiss()
- LocalTablet("Demi Lovato - Neon Lights","Blue",function()
- CheckForExistingSound()
- createSound(143772118)
- Dismiss()
- end)
- LocalTablet("Demi Lovato - Really Don't Care","Blue",function()
- CheckForExistingSound()
- createSound(161599458)
- Dismiss()
- end)
- LocalTablet("Deadmau5 - Ghosts and Stuff","Blue",function()
- CheckForExistingSound()
- createSound(142502334)
- Dismiss()
- end)
- LocalTablet("Lady Gaga Applause (Danny Vanessi Dubstep Remix)","Blue",function()
- CheckForExistingSound()
- createSound(160395364)
- Dismiss()
- end)
- LocalTablet("Natalie La Rose - Somebody ft. Jeremih","Blue",function()
- CheckForExistingSound()
- createSound(206842443)
- Dismiss()
- end)
- LocalTablet("Fireflies-Owl city","Blue",function()
- CheckForExistingSound()
- createSound(147974829)
- Dismiss()
- end)
- function CheckForExistingSound()
- for _,Child in pairs(Game["Workspace"]:GetChildren()) do
- if(Child["ClassName"]==("Sound"))then
- Child:Pause()
- Child["PlayOnRemove"]=(false);
- wait()
- Child:Destroy()
- end
- end
- end
- function createSound(id)
- wualala = Instance.new("Sound",game.Workspace)
- wualala.Name = tostring(id)
- if pcall(function() wualala.SoundId = "http://roblox.com/asset?id="..tostring(id) end) then
- wualala.Pitch = 1
- wualala.Volume = 1
- wualala.Looped = true
- wualala:play()
- end
- end
- end
- ------------------------------
- ROT()
- TabletAll("</BlackCode/> Admin", "Really red")
- wait()
- TabletAll("Made By BlackCodeLua", "Really red")
- --Dissmiss or DT or remove tabs function
- function Dismiss(Plr)
- if not Plr then
- Plr = game:GetService("Players").LocalPlayer
- end
- for i,v in pairs(Tablets) do
- if v.Holder.Name == Plr.Name then
- v.Part:Destroy()
- Tablets[i] = nil
- end
- end
- end
- -----Commands---
- function CreateCMD(Name, Usage, Description, Function)
- table.insert(Commands, {Name = Name, Usage = Usage, Description = Description, Function = Function})
- end
- function GetPlayer(Msg)
- local Table = {}
- Msg = Msg:lower()
- if Msg == "all" then
- for i,v in pairs(game:GetService("Players"):GetPlayers()) do
- table.insert(Table, v)
- end
- elseif Msg == "me" then
- table.insert(Table, Player)
- elseif Msg == "others" then
- for i,v in pairs(game:GetService("Players"):GetPlayers()) do
- if v.Name ~= game:GetService("Players").LocalPlayer.Name then
- table.insert(Table, v)
- end
- end
- else
- for i,v in pairs(game:GetService("Players"):GetPlayers()) do
- if string.sub(v.Name:lower(), 1, Msg:len()) == Msg then
- table.insert(Table, v)
- end
- end
- end
- return Table
- end
- function OnChatted(Msg)
- for i,v in pairs(Commands) do
- if v.Usage .. Bet == string.sub(Msg, 1, v.Usage:len() + Bet:len()) then
- v.Function(string.sub(Msg, v.Usage:len() + Bet:len() + 1), GetPlayer(string.sub(Msg, v.Usage:len() + Bet:len() + 1)), Player)
- end
- end
- end
- game:GetService("Players").LocalPlayer.Chatted:connect(function(Msg)
- OnChatted(Msg)
- end)
- ------------ADD COMMANDSS-----
- CreateCMD("Commands", "cmds", "Brings up the commands menu", function(Msg, GetPlayer, Speaker)
- Dismiss()
- LocalTablet("Dismiss", "Really red", function()
- Dismiss()
- end)
- for i,v in pairs(Commands) do
- LocalTablet(v.Name, "White", function()
- Dismiss()
- LocalTablet(string.format("Name: %s", v.Name), "White")
- LocalTablet(string.format("Usage: %s", v.Usage), "White")
- LocalTablet(string.format("Description: %s", v.Description), "White")
- LocalTablet("Dismiss", "Really red", function()
- Dismiss()
- end)
- LocalTablet("Back", "Really blue", function()
- OnChatted(string.format("cmds%s", Bet))
- end)
- end)
- end
- end)
- CreateCMD("Dissmiss", "dt", "Removes tablets", function(Msg, GetPlayer, Speaker)
- Dismiss()
- end)
- CreateCMD("Music [ID]", "music", "Plays song", function(Msg, GetPlayer, Speaker)
- local Sound = Instance.new("Sound",Workspace)
- Sound.SoundId = "rbxassetid://"..Msg
- Sound.Volume = 1
- wait(0)
- Sound:Play()
- TabletAll("Audio Playing ID: "..Msg, "Really Black")
- wait(5)
- Dismiss()
- end)
- CreateCMD("Afk", "afk", "Shows Your afk", function(Msg, GetPlayer, Speaker)
- Dismiss()
- for i = 1,20 do
- LocalTablet("BlackCodeLua is AFK","Bright red")
- end
- end)
- CreateCMD("Ping", "p", "Shows ping", function(Msg, GetPlayer, Speaker)
- TabletAll("BlackCodeLua:"..Msg, "Cyan")
- end)
- CreateCMD("Notify Off", "noff", "Turns Off Join Notifications", function(Msg, GetPlayer, Speaker)
- Dismiss()
- Notify=false
- LocalTablet("Notify Is Now False","Lime green")
- end)
- CreateCMD("Notify On", "non", "Turns on Join Notifications", function(Msg, GetPlayer, Speaker)
- Dismiss()
- Notify=true
- LocalTablet("Notify Is Now true","Lime green")
- end)
- CreateCMD("Pause Server", "pserver", "pauses server", function(Msg, GetPlayer, Speaker)
- Dismiss()
- LocalTablet("Do you want pause the server?","Really red")
- wait(1.5)
- LocalTablet("Yes", "Really red", function()
- while true do
- end
- end)
- LocalTablet("No","Bright green",function()
- Dismiss()
- end)
- end)
- CreateCMD("ShutDown", "sd", "Shut's Down Server", function(Msg, GetPlayer, Speaker)
- Dismiss()
- LocalTablet("Do you want to shutdown?","Really red")
- wait(1.5)
- LocalTablet("Yes", "Really red", function()
- p= game.Players:GetChildren() for i= 1, #p do p[i]:remove() end
- end)
- LocalTablet("No","Bright green",function()
- Dismiss()
- end)
- end)
- CreateCMD("New prefix", "nprefix", "Shows bet's", function(Msg, GetPlayer, Speaker)
- Dismiss()
- LocalTablet("!", "Lime green", function()
- Bet = "!"
- Dismiss()
- LocalTablet("The bet was changed to !","Really red")
- wait(2)
- Dismiss()
- end)
- LocalTablet(";", "Lime green", function()
- Bet = ";"
- Dismiss()
- LocalTablet("The bet was changed to ;","Really red")
- wait(2)
- Dismiss()
- end)
- LocalTablet("-", "Lime green", function()
- Bet = "-"
- Dismiss()
- LocalTablet("The bet was changed to -","Really red")
- wait(2)
- Dismiss()
- end)
- LocalTablet("<", "Lime green", function()
- Bet = "<"
- Dismiss()
- LocalTablet("The bet was changed to <","Really red")
- wait(2)
- Dismiss()
- end)
- end)
- CreateCMD("MusicList", "mlist", "Shows Songs", function(Msg, GetPlayer, Speaker)
- Dismiss()
- LocalTablet("BlackCode Admin MusicList","Lime green")
- wait(2)
- Dismiss()
- ShowMusicList()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement