Advertisement
Rovo112

BlackCodeTabs

Feb 17th, 2015
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.17 KB | None | 0 0
  1. --[BlackCodeAdmin Tabs]--
  2. wait()
  3. Commands = {}
  4. Player = game:GetService("Players").LocalPlayer --Local Admin
  5. Bet = "<"
  6. Tablets = {};
  7.  
  8. print('BlackCode Admin')
  9. wait(.95)
  10. print ('Functions are loaded')
  11. script.Parent = nil
  12. Tablets = {}
  13. Rotation = 0
  14. RotationAddValue = 0.0004
  15. script.Name = "<>|BlackCode Admin|<>"
  16. Notify=true
  17. --Part/OutPut--
  18. function Tablet(Plr, Text, Color, onClicked,onTouched)
  19. pcall(function() local a = Color.r if type(a) == "number" then Color = a end end)
  20. pcall(function() local a = BrickColor.new(Color) if a then Color = a.Color end end)
  21. if not pcall(function() local a = Color.r if type(a) ~= "number" then error() end end) then
  22. Color = "White"
  23. end
  24. if Color == nil then Color='White' end
  25. if Plr.Character.Torso == nil then
  26. return
  27. end
  28. local Insert = {}
  29. local tab = Instance.new("Part", game:GetService("Workspace")) --Might Change To StarterPlayer or Lighting
  30. local light = Instance.new("PointLight", tab)
  31. light.Enabled = true
  32. light.Range = 15
  33. tab.Name = tostring(math.random(-99999,99999))
  34. tab.FormFactor = "Custom"
  35. tab.Size = Vector3.new(2.8, 2.8, 2.8)
  36. tab.Shape = "Ball"
  37. tab.Material = "Foil"
  38. tab.Anchored = true
  39. tab.Locked = true
  40. tab.CanCollide = false
  41. tab.Transparency = 0.3
  42. tab.Color = BrickColor.new(Color).Color
  43. tab.CFrame = Plr.Character.Torso.CFrame * CFrame.new(8,0,8)
  44. if onTouched~=nil then
  45. tab.Touched:connect(function(what)
  46. a,b=ypcall(function()
  47. onTouched(what)
  48. end)
  49. if not a then error(b) end
  50. end)
  51. end
  52.  
  53. --[[local box = Instance.new("SelectionBox", tab) --With ball shape it doesnt look good
  54. box.Adornee = box.Parent
  55. box.Transparency = 0.5
  56. box.Color = BrickColor.new(Color)]]
  57.  
  58. local gui = Instance.new("BillboardGui", tab)
  59. gui.Adornee = tab
  60. gui.StudsOffset = Vector3.new(0,tab.Size.Y+0.5,0)
  61. gui.Size = UDim2.new(1,0,1,0)
  62. local text = Instance.new("TextLabel", gui)
  63. text.BackgroundTransparency = 1
  64. text.Text = tostring(Text)
  65. text.Position = UDim2.new(0.5,0,0.5,0)
  66. text.Font = "ArialBold"
  67. text.FontSize = "Size18"
  68. text.TextColor3 = Color
  69. text.TextStrokeTransparency = 1
  70. local Click = Instance.new("ClickDetector", tab)
  71. Click.MaxActivationDistance = math.huge
  72. Click.MouseHoverEnter:connect(function(Player)
  73. if Player.Name == Plr.Name then
  74. tab.Transparency = 0.2
  75. tab.Size = Vector3.new(3.8,3.8,3.8)
  76. --box.Transparency = 0.2--Ball Shape Errors
  77. end
  78. end)
  79. Click.MouseHoverLeave:connect(function(Player)
  80. if Player.Name == Plr.Name then
  81. tab.Transparency = 0.5
  82. tab.Size = Vector3.new(2.8, 2.8, 2.8)
  83. --box.Transparency = 0.5--Ball Shape Errors
  84. end
  85. end)
  86. Click.MouseClick:connect(function(Player)
  87. if Player.Name == Plr.Name then
  88. if onClicked == nil then
  89. tab:Destroy()
  90.  
  91. for i,v in pairs(Tablets) do
  92. if v.Part.Name == tab.Name and v.Holder.Name == Plr.Name then
  93. table.remove(Tablets, i)
  94. end
  95. end
  96. else
  97. local Run,Error = ypcall(function()
  98. onClicked()
  99. end)
  100. if Error then
  101. Tablet(Plr, tostring(Error), "Really red")
  102. end
  103. tab:Destroy()
  104. for i,v in pairs(Tablets) do
  105. if v.Part.Name == tab.Name and v.Holder.Name == Plr.Name then
  106. table.remove(Tablets, i)
  107. end
  108. end
  109. end
  110. end
  111. end)
  112. Insert.Holder = Plr
  113. Insert.Part = tab
  114. table.insert(Tablets, Insert)
  115. end
  116.  
  117. ROT=function()
  118. game:GetService("RunService").Heartbeat:connect(function()
  119. pcall(function()
  120. for _,v in pairs(game:GetService("Players"):GetPlayers()) do
  121. if v.Character.Head then
  122. Rotation = Rotation + RotationAddValue
  123. --Rotation=0.0002
  124. local AllTabs = {}
  125. for _,tab in pairs(Tablets) do
  126. if tab.Holder.Name == v.Name then
  127. table.insert(AllTabs, tab)
  128. end
  129. end
  130. for i = 1, #AllTabs do
  131. pcall(function()
  132. local Position = v.Character.Head.CFrame.p
  133. local Radius = (#AllTabs * 0.5) + 5
  134. local M = (i / #AllTabs - (0.5 / #AllTabs) * Rotation * 2) * math.pi * (4/2)
  135. local X = math.sin(M) * Radius
  136. local Y = 0
  137. local Z = math.cos(M) * Radius
  138. local A = Vector3.new(X, Y, Z) + Position
  139. local B = AllTabs[i].Part.CFrame.p
  140. local C = A * 0.1 + B * 0.9
  141. AllTabs[i].Part.CFrame = CFrame.new(C, Position)
  142. end)
  143. end
  144. end
  145. end
  146. end)
  147. end)
  148. end
  149. ------------------------------ Get All Players OutPut
  150. function TabletAll(text, color)
  151. for i,v in pairs(game.Players:GetPlayers()) do
  152. Tablet(v, text, color)
  153. end
  154. end
  155.  
  156. function LocalTablet(Text, Color, onClicked,onTouched)
  157. pcall(function() Tablet(game.Players.LocalPlayer,Text,Color,onClicked,onTouched) end)
  158. end
  159.  
  160. ---------------------Join Output
  161. game.Players.ChildAdded:connect(function(plr)
  162. if (Notify == true) then
  163. LocalTablet("</BlackCode/>: "..plr.Name.." Has Connected To Server!", "Lime green")
  164. end
  165. end)
  166.  
  167. --------------------- Main Functions and stuff
  168. function ShowMusicList()
  169. Dismiss()
  170.  
  171. LocalTablet("Demi Lovato - Neon Lights","Blue",function()
  172.  
  173. CheckForExistingSound()
  174.  
  175. createSound(143772118)
  176. Dismiss()
  177.  
  178. end)
  179. LocalTablet("Demi Lovato - Really Don't Care","Blue",function()
  180. CheckForExistingSound()
  181.  
  182. createSound(161599458)
  183. Dismiss()
  184. end)
  185.  
  186. LocalTablet("Deadmau5 - Ghosts and Stuff","Blue",function()
  187. CheckForExistingSound()
  188.  
  189. createSound(142502334)
  190. Dismiss()
  191. end)
  192. LocalTablet("Lady Gaga Applause (Danny Vanessi Dubstep Remix)","Blue",function()
  193. CheckForExistingSound()
  194.  
  195. createSound(160395364)
  196. Dismiss()
  197. end)
  198. LocalTablet("Natalie La Rose - Somebody ft. Jeremih","Blue",function()
  199. CheckForExistingSound()
  200.  
  201. createSound(206842443)
  202. Dismiss()
  203. end)
  204. LocalTablet("Fireflies-Owl city","Blue",function()
  205. CheckForExistingSound()
  206.  
  207. createSound(147974829)
  208. Dismiss()
  209. end)
  210.  
  211. function CheckForExistingSound()
  212.  
  213. for _,Child in pairs(Game["Workspace"]:GetChildren()) do
  214.  
  215. if(Child["ClassName"]==("Sound"))then
  216.  
  217. Child:Pause()
  218.  
  219. Child["PlayOnRemove"]=(false);
  220.  
  221. wait()
  222.  
  223. Child:Destroy()
  224.  
  225. end
  226.  
  227. end
  228.  
  229. end
  230. function createSound(id)
  231. wualala = Instance.new("Sound",game.Workspace)
  232. wualala.Name = tostring(id)
  233. if pcall(function() wualala.SoundId = "http://roblox.com/asset?id="..tostring(id) end) then
  234. wualala.Pitch = 1
  235. wualala.Volume = 1
  236. wualala.Looped = true
  237. wualala:play()
  238. end
  239. end
  240. end
  241.  
  242.  
  243. ------------------------------
  244.  
  245. ROT()
  246.  
  247. TabletAll("</BlackCode/> Admin", "Really red")
  248. wait()
  249. TabletAll("Made By BlackCodeLua", "Really red")
  250.  
  251.  
  252.  
  253. --Dissmiss or DT or remove tabs function
  254. function Dismiss(Plr)
  255. if not Plr then
  256. Plr = game:GetService("Players").LocalPlayer
  257. end
  258. for i,v in pairs(Tablets) do
  259. if v.Holder.Name == Plr.Name then
  260. v.Part:Destroy()
  261. Tablets[i] = nil
  262. end
  263. end
  264. end
  265.  
  266. -----Commands---
  267.  
  268.  
  269. function CreateCMD(Name, Usage, Description, Function)
  270. table.insert(Commands, {Name = Name, Usage = Usage, Description = Description, Function = Function})
  271. end
  272.  
  273. function GetPlayer(Msg)
  274. local Table = {}
  275. Msg = Msg:lower()
  276. if Msg == "all" then
  277. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  278. table.insert(Table, v)
  279. end
  280. elseif Msg == "me" then
  281. table.insert(Table, Player)
  282. elseif Msg == "others" then
  283. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  284. if v.Name ~= game:GetService("Players").LocalPlayer.Name then
  285. table.insert(Table, v)
  286. end
  287. end
  288. else
  289. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  290. if string.sub(v.Name:lower(), 1, Msg:len()) == Msg then
  291. table.insert(Table, v)
  292. end
  293. end
  294. end
  295. return Table
  296. end
  297.  
  298. function OnChatted(Msg)
  299. for i,v in pairs(Commands) do
  300. if v.Usage .. Bet == string.sub(Msg, 1, v.Usage:len() + Bet:len()) then
  301. v.Function(string.sub(Msg, v.Usage:len() + Bet:len() + 1), GetPlayer(string.sub(Msg, v.Usage:len() + Bet:len() + 1)), Player)
  302. end
  303. end
  304. end
  305.  
  306. game:GetService("Players").LocalPlayer.Chatted:connect(function(Msg)
  307. OnChatted(Msg)
  308. end)
  309.  
  310.  
  311. ------------ADD COMMANDSS-----
  312.  
  313. CreateCMD("Commands", "cmds", "Brings up the commands menu", function(Msg, GetPlayer, Speaker)
  314. Dismiss()
  315. LocalTablet("Dismiss", "Really red", function()
  316. Dismiss()
  317. end)
  318. for i,v in pairs(Commands) do
  319. LocalTablet(v.Name, "White", function()
  320. Dismiss()
  321. LocalTablet(string.format("Name: %s", v.Name), "White")
  322. LocalTablet(string.format("Usage: %s", v.Usage), "White")
  323. LocalTablet(string.format("Description: %s", v.Description), "White")
  324. LocalTablet("Dismiss", "Really red", function()
  325. Dismiss()
  326. end)
  327. LocalTablet("Back", "Really blue", function()
  328. OnChatted(string.format("cmds%s", Bet))
  329. end)
  330. end)
  331. end
  332. end)
  333.  
  334. CreateCMD("Dissmiss", "dt", "Removes tablets", function(Msg, GetPlayer, Speaker)
  335. Dismiss()
  336. end)
  337.  
  338. CreateCMD("Music [ID]", "music", "Plays song", function(Msg, GetPlayer, Speaker)
  339. local Sound = Instance.new("Sound",Workspace)
  340. Sound.SoundId = "rbxassetid://"..Msg
  341. Sound.Volume = 1
  342. wait(0)
  343. Sound:Play()
  344. TabletAll("Audio Playing ID: "..Msg, "Really Black")
  345. wait(5)
  346. Dismiss()
  347. end)
  348.  
  349. CreateCMD("Afk", "afk", "Shows Your afk", function(Msg, GetPlayer, Speaker)
  350. Dismiss()
  351. for i = 1,20 do
  352. LocalTablet("BlackCodeLua is AFK","Bright red")
  353. end
  354. end)
  355.  
  356. CreateCMD("Ping", "p", "Shows ping", function(Msg, GetPlayer, Speaker)
  357. TabletAll("BlackCodeLua:"..Msg, "Cyan")
  358. end)
  359.  
  360. CreateCMD("Notify Off", "noff", "Turns Off Join Notifications", function(Msg, GetPlayer, Speaker)
  361. Dismiss()
  362. Notify=false
  363. LocalTablet("Notify Is Now False","Lime green")
  364. end)
  365.  
  366. CreateCMD("Notify On", "non", "Turns on Join Notifications", function(Msg, GetPlayer, Speaker)
  367. Dismiss()
  368. Notify=true
  369. LocalTablet("Notify Is Now true","Lime green")
  370. end)
  371.  
  372. CreateCMD("Pause Server", "pserver", "pauses server", function(Msg, GetPlayer, Speaker)
  373. Dismiss()
  374. LocalTablet("Do you want pause the server?","Really red")
  375. wait(1.5)
  376. LocalTablet("Yes", "Really red", function()
  377. while true do
  378. end
  379. end)
  380. LocalTablet("No","Bright green",function()
  381. Dismiss()
  382. end)
  383. end)
  384.  
  385. CreateCMD("ShutDown", "sd", "Shut's Down Server", function(Msg, GetPlayer, Speaker)
  386. Dismiss()
  387. LocalTablet("Do you want to shutdown?","Really red")
  388. wait(1.5)
  389. LocalTablet("Yes", "Really red", function()
  390. p= game.Players:GetChildren() for i= 1, #p do p[i]:remove() end
  391. end)
  392. LocalTablet("No","Bright green",function()
  393. Dismiss()
  394. end)
  395. end)
  396.  
  397.  
  398. CreateCMD("New prefix", "nprefix", "Shows bet's", function(Msg, GetPlayer, Speaker)
  399. Dismiss()
  400. LocalTablet("!", "Lime green", function()
  401. Bet = "!"
  402. Dismiss()
  403. LocalTablet("The bet was changed to !","Really red")
  404. wait(2)
  405. Dismiss()
  406. end)
  407. LocalTablet(";", "Lime green", function()
  408. Bet = ";"
  409. Dismiss()
  410. LocalTablet("The bet was changed to ;","Really red")
  411. wait(2)
  412. Dismiss()
  413. end)
  414. LocalTablet("-", "Lime green", function()
  415. Bet = "-"
  416. Dismiss()
  417. LocalTablet("The bet was changed to -","Really red")
  418. wait(2)
  419. Dismiss()
  420. end)
  421. LocalTablet("<", "Lime green", function()
  422. Bet = "<"
  423. Dismiss()
  424. LocalTablet("The bet was changed to <","Really red")
  425. wait(2)
  426. Dismiss()
  427. end)
  428. end)
  429.  
  430. CreateCMD("MusicList", "mlist", "Shows Songs", function(Msg, GetPlayer, Speaker)
  431. Dismiss()
  432. LocalTablet("BlackCode Admin MusicList","Lime green")
  433. wait(2)
  434. Dismiss()
  435.  
  436. ShowMusicList()
  437.  
  438. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement