coolgoldboy166

beatmarker

Nov 13th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.59 KB | None | 0 0
  1. scrgui = Instance.new("ScreenGui",game.Players.LocalPlayer.PlayerGui)
  2. --
  3. sound = Instance.new("Sound",scrgui)
  4. --
  5. fr1 = Instance.new("Frame",scrgui)
  6. fr1tl1 = Instance.new("TextLabel",fr1)
  7. --
  8. fr4 = Instance.new("Frame",fr1)
  9. fr4tb1 = Instance.new("TextButton",fr4)
  10. --
  11. fr2 = Instance.new("Frame",fr1)
  12. fr2tb1 = Instance.new("TextBox",fr2)
  13. fr2tl1 = Instance.new("TextLabel",fr2)
  14. fr2tl2 = Instance.new("TextLabel",fr2)
  15. vslz = Instance.new("Frame",fr2)
  16. fr2tl3 = Instance.new("TextLabel",fr2)
  17. --
  18. fr3 = Instance.new("Frame",fr2)
  19. fr3tl1 = Instance.new("TextLabel",fr3)
  20. fr3tl2 = Instance.new("TextLabel",fr3)
  21. fr3tl2tb1 = Instance.new("TextButton",fr3tl2)
  22. fr3tl3 = Instance.new("TextLabel",fr3)
  23. fr3tl3tb1 = Instance.new("TextBox",fr3tl3)
  24. fr3tb1 = Instance.new("TextButton",fr3)
  25. --
  26. scrf = Instance.new("ScrollingFrame",fr2)
  27. looped = false
  28.  
  29. function clr(num1, num2, num3) --color3 converter function
  30. local color1 = num1/255
  31. local color2 = num2/255
  32. local color3 = num3/255
  33. return Color3.new(color1, color2, color3)
  34. end
  35.  
  36. textcolor = clr(255,255,255)
  37. textcolor2 = clr(0,0,0)
  38.  
  39. --music
  40.  
  41. local music = { --25
  42. "467369212",
  43. "492272696",
  44. "561274893",
  45. "461736208",
  46. "438917260",
  47. "453400361",
  48. "399781334",
  49. "413625451",
  50. "259455471",
  51. "257201201",
  52. "526008067",
  53. "153710433",
  54. "300036856",
  55. "209314579",
  56. "179667611",
  57. "320341182",
  58. "162068260",
  59. "328474897",
  60. "236181263",
  61. "476664237",
  62. "144026962",
  63. "291317957",
  64. "458526475",
  65. "408844261",
  66. "495007399"
  67. }
  68.  
  69. local musicnames = {
  70. "The Chainsmokers - Closer",
  71. "Rae Sremmurd - Black Beatles",
  72. "The Weeknd - Starboy",
  73. "Major Lazer - Cold Water",
  74. "twenty one pilots - Heathens",
  75. "Marshmello - Keep it Mello",
  76. "Drake - One Dance",
  77. "Marshmello - Alone",
  78. "twenty one pilots - Ride",
  79. "Timmy Trumpet - Freaks",
  80. "Bruno Mars - 24K Magic",
  81. "Linkin Park - Castle of Glass",
  82. "Linkin Park - Faint",
  83. "Spag Heddy - The Master (VIP)",
  84. "Spag Heddy - Pink Koeks",
  85. "Bastille - Pompeii",
  86. "Attila - Rage",
  87. "Major Lazer - Lean On",
  88. "Rockstar North - Welcome to Los Santos",
  89. "Rockstar North - Grand Theft Auto IV",
  90. "Rockstar North - San Andreas Theme",
  91. "Rockstar San Diego - Far Away",
  92. "The Chainsmokers - Don't Let Me Down (W&W Remix)",
  93. "WiDE AWAKE - Love Me",
  94. "Various Artists - Sucker For Pain"
  95. }
  96.  
  97. --name
  98.  
  99. fr1.Name = "fr1"
  100. fr1tl1.Name = "fr1tl1"
  101. fr4.Name = "fr4"
  102. fr4tb1.Name = "fr4tb1"
  103. fr2.Name = "fr2"
  104. fr2tb1.Name = "fr2tb1"
  105. fr2tl1.Name = "fr2tl1"
  106. fr2tl2.Name = "fr2tl2"
  107. fr3.Name = "fr3"
  108. fr3tl1.Name = "fr3tl1"
  109. fr3tl2.Name = "fr3tl2"
  110. fr3tl2tb1.Name = "fr3tl2tb1"
  111. fr3tl3.Name = "fr3tl3"
  112. fr3tl3tb1.Name = "fr3tl3tb1"
  113. scrf.Name = "scrf"
  114. vslz.Name = "vslz"
  115. fr3tb1.Name = "fr3tb1"
  116. fr2tl3.Name = "fr2tl3"
  117.  
  118. --create preset music tabs
  119.  
  120. for i=1,#musicnames do
  121. local sbc = Instance.new("TextButton",scrf)
  122. sbc.Name = i
  123. sbc.Size = UDim2.new(1, 0,0, 25)
  124. sbc.Position = UDim2.new(0, 0, 0, (i*25)-25)
  125. sbc.BorderSizePixel = 0
  126. sbc.BackgroundColor3 = clr(143, 121, 32)
  127. sbc.Font = "SourceSansBold"
  128. sbc.FontSize = "Size18"
  129. sbc.TextColor3 = textcolor
  130. sbc.TextWrapped = true
  131. sbc.Text = musicnames[i]
  132. sbc.AutoButtonColor = false
  133. if (i % 2 == 0) then
  134. sbc.BackgroundTransparency = 0.7
  135. else
  136. sbc.BackgroundTransparency = 0.3
  137. end
  138. sbc.MouseButton1Click:connect(function()
  139. sound.SoundId = "rbxassetid://"..music[i]
  140. sound:Play()
  141. fr2tl2.Text = "Now Playing: "..musicnames[i]
  142. end)
  143. end
  144.  
  145. --backgroundcolor3
  146.  
  147. fr1.BackgroundColor3 = clr(236, 240, 241)
  148. fr1tl1.BackgroundColor3 = clr(44, 62, 80)
  149. fr4.BackgroundColor3 = clr(231, 76, 60)
  150. fr4tb1.BackgroundColor3 = clr(231, 76, 60)
  151. fr2.BackgroundColor3 = clr(200, 167, 0)
  152. fr2tb1.BackgroundColor3 = clr(236, 240, 241)
  153. fr2tl1.BackgroundColor3 = clr(255, 255, 255)
  154. fr2tl2.BackgroundColor3 = clr(200, 167, 0)
  155. fr3.BackgroundColor3 = clr(177, 134, 4)
  156. fr3tl1.BackgroundColor3 = clr(255, 255, 255)
  157. fr3tl2.BackgroundColor3 = clr(255, 255, 255)
  158. fr3tl2tb1.BackgroundColor3 = clr(236, 240, 241)
  159. fr3tl3.BackgroundColor3 = clr(255, 255, 255)
  160. fr3tl3tb1.BackgroundColor3 = clr(236, 240, 241)
  161. scrf.BackgroundColor3 = clr(177, 134, 4)
  162. vslz.BackgroundColor3 = clr(177, 134, 4)
  163. fr3tb1.BackgroundColor3 = clr(177, 134, 4)
  164.  
  165. --backgroundtransparency
  166.  
  167. fr1.BackgroundTransparency = 0.3
  168. fr1tl1.BackgroundTransparency = 1
  169. fr4.BackgroundTransparency = 0.3
  170. fr4tb1.BackgroundTransparency = 1
  171. fr2.BackgroundTransparency = 0.3
  172. fr2tb1.BackgroundTransparency = 0
  173. fr2tl1.BackgroundTransparency = 1
  174. fr2tl2.BackgroundTransparency = 0.3
  175. fr3.BackgroundTransparency = 0.6
  176. fr3tl1.BackgroundTransparency = 1
  177. fr3tl2.BackgroundTransparency = 1
  178. fr3tl2tb1.BackgroundTransparency = 0
  179. fr3tl3.BackgroundTransparency = 1
  180. fr3tl3tb1.BackgroundTransparency = 0
  181. scrf.BackgroundTransparency = 0.6
  182. vslz.BackgroundTransparency = 0.6
  183. fr3tb1.BackgroundTransparency = 0.6
  184. fr2tl3.BackgroundTransparency = 1
  185.  
  186. --bordersizepixel
  187.  
  188. fr1.BorderSizePixel = 0
  189. fr1tl1.BorderSizePixel = 0
  190. fr4.BorderSizePixel = 0
  191. fr4tb1.BorderSizePixel = 0
  192. fr2.BorderSizePixel = 0
  193. fr2tb1.BorderSizePixel = 0
  194. fr2tl1.BorderSizePixel = 0
  195. fr2tl2.BorderSizePixel = 0
  196. fr3.BorderSizePixel = 0
  197. fr3tl1.BorderSizePixel = 0
  198. fr3tl2.BorderSizePixel = 0
  199. fr3tl2tb1.BorderSizePixel = 0
  200. fr3tl3.BorderSizePixel = 0
  201. fr3tl3tb1.BorderSizePixel = 0
  202. scrf.BorderSizePixel = 0
  203. vslz.BorderSizePixel = 0
  204. fr3tb1.BorderSizePixel = 0
  205. fr2tl3.BorderSizePixel = 0
  206.  
  207. --position
  208.  
  209. fr1.Position = UDim2.new(0, 42,0, 250)
  210. fr1tl1.Position = UDim2.new(0.5, -1,0.5, -2)
  211. fr4.Position = UDim2.new(1, -23,0, 2)
  212. fr4tb1.Position = UDim2.new(0, 0,0, -1)
  213. fr2.Position = UDim2.new(0, 0,0, 25)
  214. fr2tb1.Position = UDim2.new(1, -135,0, 40)
  215. fr2tl1.Position = UDim2.new(1, -175,0, 0)
  216. fr2tl2.Position = UDim2.new(0, 0, 1, 0)
  217. fr3.Position = UDim2.new(1, -135,0, 75)
  218. fr3tl1.Position = UDim2.new(0, 0,0, 0)
  219. fr3tl2.Position = UDim2.new(0, 4,0, 30)
  220. fr3tl2tb1.Position = UDim2.new(1, -15,0.5, -5)
  221. fr3tl3.Position = UDim2.new(0, 4,0, 50)
  222. fr3tl3tb1.Position = UDim2.new(1, -15,0.5, -5)
  223. scrf.Position = UDim2.new(0, 5,0, 5)
  224. vslz.Position = UDim2.new(0, 317,0, 175)
  225. fr3tb1.Position = UDim2.new(0, 2, 0, 252)
  226. fr2tl3.Position = UDim2.new(0, 315, 1, 8)
  227.  
  228. --size
  229.  
  230. fr1.Size = UDim2.new(0, 450,0, 25)
  231. fr1tl1.Size = UDim2.new(0, 1,0, 1)
  232. fr4.Size = UDim2.new(0, 21,0, 21)
  233. fr4tb1.Size = UDim2.new(0, 21,0, 21)
  234. fr2.Size = UDim2.new(0, 450,0, 350)
  235. fr2tb1.Size = UDim2.new(0, 125,0, 25)
  236. fr2tl1.Size = UDim2.new(0, 200,0, 50)
  237. fr2tl2.Size = UDim2.new(1, 0, 0, 35)
  238. fr3.Size = UDim2.new(0, 125,0, 75)
  239. fr3tl1.Size = UDim2.new(1, 0,0, 20)
  240. fr3tl2.Size = UDim2.new(1, -8,0, 20)
  241. fr3tl2tb1.Size = UDim2.new(0, 15,0, 15)
  242. fr3tl3.Size = UDim2.new(1, -8,0, 20)
  243. fr3tl3tb1.Size = UDim2.new(0, 15,0, 15)
  244. scrf.Size = UDim2.new(0, 300,1, -10)
  245. scrf.CanvasSize = UDim2.new(0, 0, 0, 750)
  246. scrf.ScrollBarThickness = 4
  247. vslz.Size = UDim2.new(0, 122, 0, 150)
  248. fr3tb1.Size = UDim2.new(0, 122, 0, 22)
  249. fr2tl3.Size = UDim2.new(0.35, 0, 0, 35)
  250.  
  251. --text
  252.  
  253. fr3tl1.Text = "Settings"
  254. fr3tl2.Text = "Looped"
  255. fr3tl3.Text = "Volume (0.1-10)"
  256. fr3tl2tb1.Text = ""
  257. fr3tl3tb1.Text = ""
  258. fr2tb1.Text = "Music ID"
  259. fr2tl1.Text = "Or, enter your own..."
  260. fr2tl2.Text = "Nothing is playing."
  261. fr1tl1.Text = "Lines v1.1"
  262. fr4tb1.Text = "X"
  263. fr3tb1.Text = "Stop Music"
  264. fr2tl3.Text = "Beta v1.1 by new_line"
  265.  
  266. --textcolor
  267.  
  268. fr3tl1.TextColor3 = textcolor
  269. fr3tl2.TextColor3 = textcolor
  270. fr3tl3.TextColor3 = textcolor
  271. fr3tl2tb1.TextColor3 = textcolor
  272. fr3tl3tb1.TextColor3 = textcolor2
  273. fr2tb1.TextColor3 = textcolor2
  274. fr2tl1.TextColor3 = textcolor
  275. fr2tl2.TextColor3 = textcolor
  276. fr1tl1.TextColor3 = textcolor2
  277. fr4tb1.TextColor3 = textcolor
  278. fr3tb1.TextColor3 = textcolor
  279. fr2tl3.TextColor3 = textcolor
  280.  
  281. --fontsize
  282.  
  283. fr3tl1.FontSize = "Size14"
  284. fr3tl2.FontSize = "Size18"
  285. fr3tl3.FontSize = "Size18"
  286. fr3tl2tb1.FontSize = "Size14"
  287. fr3tl3tb1.FontSize = "Size14"
  288. fr2tb1.FontSize = "Size14"
  289. fr2tl1.FontSize = "Size18"
  290. fr2tl2.FontSize = "Size18"
  291. fr1tl1.FontSize = "Size32"
  292. fr4tb1.FontSize = "Size14"
  293. fr4tb1.TextScaled = true
  294. fr3tb1.FontSize = "Size14"
  295. fr2tl3.FontSize = "Size14"
  296.  
  297. --font
  298.  
  299. fr3tl1.Font = "SourceSansItalic"
  300. fr3tl2.Font = "SourceSansLight"
  301. fr3tl3.Font = "SourceSansLight"
  302. fr3tl2tb1.Font = "SourceSans"
  303. fr3tl3tb1.Font = "SourceSans"
  304. fr2tb1.Font = "SourceSans"
  305. fr2tl1.Font = "SourceSansItalic"
  306. fr2tl2.Font = "SourceSansItalic"
  307. fr2tl3.Font = "SourceSansItalic"
  308. fr1tl1.Font = "SourceSansLight"
  309. fr4tb1.Font = "SourceSansBold"
  310. fr3tb1.Font = "SourceSansLight"
  311.  
  312. fr2tl2.TextWrapped = true
  313. fr3tl2.TextXAlignment = "Left"
  314. fr3tl3.TextXAlignment = "Left"
  315.  
  316. fr3tl2tb1.MouseButton1Click:connect(function()
  317. if not looped then
  318. looped = true
  319. sound.Looped = true
  320. fr3tl2tb1.BackgroundColor3 = clr(178, 180, 181)
  321. else
  322. looped = false
  323. sound.Looped = false
  324. fr3tl2tb1.BackgroundColor3 = clr(236, 240, 241)
  325. end
  326. end)
  327.  
  328. fr3tl3tb1.FocusLost:connect(function()
  329. if tonumber(fr3tl3tb1.Text) < 11 and tonumber(fr3tl3tb1.Text) >= 0.1 then
  330. sound.Volume = fr3tl3tb1.Text
  331. fr3tl3tb1.Text = ""
  332. end
  333. end)
  334.  
  335. fr2tb1.FocusLost:connect(function()
  336. local custom = game:GetService("MarketplaceService"):GetProductInfo(fr2tb1.Text)
  337. if custom.AssetTypeId == 3 then
  338. fr2tl2.Text = "Now Playing: "..custom.Name
  339. sound.SoundId = "rbxassetid://"..fr2tb1.Text
  340. sound:Play()
  341. else
  342. fr2tl2.Text = "Invalid ID: "..fr2tb1.Text
  343. end
  344.  
  345. end)
  346.  
  347. fr3tb1.MouseButton1Click:connect(function()
  348. for i, v in next,vslz:GetChildren() do
  349. v:TweenSize(UDim2.new(0, 2, 0, 1), "Out", "Quad", .2, true)
  350. end
  351. sound.SoundId = 0
  352. fr2tl2.Text = "Nothing is playing."
  353. end)
  354.  
  355. fr1.Draggable = true
  356. fr1.Active = true
  357.  
  358. for a=1,39 do
  359. local vsb = Instance.new("Frame",vslz)
  360. vsb.Name = "vsb"..a-1
  361. vsb.Size = UDim2.new(0,2,0,1)
  362. vsb.Position = UDim2.new(0,(a*3)-1,1,0)
  363. vsb.BackgroundColor3 = clr(255, 255, 255)
  364. vsb.BackgroundTransparency = 0.6
  365. vsb.BorderSizePixel = 0
  366. vsb.AnchorPoint = Vector2.new(0,1)
  367. end
  368.  
  369. local Bars = {}
  370.  
  371. for i,v in next,vslz:GetChildren() do
  372. table.insert(Bars, v)
  373. end
  374.  
  375. Height = 148
  376.  
  377.  
  378. local nBars,Tweens=#Bars-1,{}
  379.  
  380. local function quadIn(t,b,c,d) t=t/d; return c*t*t+b; end;
  381. local function quadOut(t,b,c,d) t=t/d; return -c*t*(t-2)+b; end;
  382. local function Quad(obj,val,ease,d)
  383. local t,f,con,nt,st,sd=tick()
  384. Tweens[obj]=t -- Set identifier
  385. st=obj.Size.Y.Offset -- Start Value
  386. sd=val-st -- Change in Value
  387. f=ease=='In' and quadIn or quadOut -- Choose between Out/In
  388. con=game:GetService'RunService'.RenderStepped:connect(function() nt=tick()-t
  389. if Tweens[obj]~=t then -- Check for override
  390. con:disconnect()
  391. return
  392. end
  393. local nv=math.max(.2,f(math.min(d,nt),st,sd,d)) -- New Value
  394. obj.Size=UDim2.new(0, 2, 0, nv)
  395. if nt>d then -- Easing done?
  396. con:disconnect()
  397. if ease~='In' then
  398. Quad(obj,.2,'In',.3) -- Drop the bar
  399. end
  400. end
  401. end)
  402. end
  403.  
  404. local function CheckSet(N,S,D) -- Number, Scale, Direction
  405. local nS=vslz["vsb"..tostring(N)].Size.Y.Offset
  406. if S>nS then
  407. Set(N,nS+(S-nS)/3,D)
  408. end
  409. end
  410.  
  411. function Set(N,S,D) -- Number, Scale, Direction
  412. Quad(vslz["vsb"..tostring(N)],S,'Out',.1)
  413. if N>0 and D~=1 then -- Checks left for smaller bars to manipulate
  414. CheckSet(N-1,S,-1)
  415. end
  416. if N<nBars and D~=-1 then -- Checks right...
  417. CheckSet(N+1,S,1)
  418. end
  419. end
  420.  
  421. -- RENDER LOOP --
  422. local MPL,PL,curr=0 curr=sound.SoundId
  423. game:service'RunService'.RenderStepped:connect(function()
  424. PL=sound.PlaybackLoudness
  425. if sound.IsPlaying and PL==PL then -- Sound is playing & PlaybackLoudness is not undefined
  426. if curr~=sound.SoundId then MPL=0 -- Reset the relative Max PlaybackLoudness on song change
  427. curr=sound.SoundId
  428. end
  429. MPL=math.max(PL,MPL) PL=PL/MPL -- Normalize PL based on relative Max PlaybackLoudness
  430. if PL==PL then
  431. Set(math.floor(PL*nBars),PL*Height) -- Modify bar relative to PlaybackLoudness
  432. end
  433. end
  434. end)
Add Comment
Please, Sign In to add comment