Advertisement
memesbruh03

Music Player GUI 1.2.0

Oct 7th, 2016
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.07 KB | None | 0 0
  1. -- adchand2's music player 1.2.0
  2.  
  3. --[[
  4.  
  5.   what's new?
  6.  
  7. - 1.1.0
  8. · starting message
  9. · you can now choose what colour (cyan by default) you want it to be if you want to post this as a new script/paste
  10. · clicking the play button now shows bgm info on top
  11. · main frame is now draggable (might not work but could be fixed soon)
  12.  
  13. - 1.1.1
  14. · now you can set the font for the music player itself
  15. · dragging the gui still doesn't work
  16. · new bgm info appears above character
  17.  
  18. ]]
  19.  
  20. print("Starting adchand2's music player 1.2.0...")
  21.  
  22. -- define player variable
  23. local Player=game.Players.LocalPlayer
  24.  
  25. -- appearance
  26. col=Color3.fromRGB(0,255,255)
  27. font=Enum.Font.Code
  28.  
  29. -- creation of gui
  30. local scrg=Instance.new("ScreenGui",Player.PlayerGui)
  31. local credit=Instance.new("TextLabel",scrg)
  32. credit.BackgroundColor3=Color3.fromRGB(255,255,255)
  33. credit.BackgroundTransparency=1
  34. credit.Position=UDim2.new(0,0,1,-18)
  35. credit.Size=UDim2.new(1,0,0,18)
  36. credit.Font=font
  37. credit.FontSize=Enum.FontSize.Size18
  38. credit.Text="More SCRIPTS by adchand2 available at: http://pastebin.com/u/memesbruh03"
  39. credit.TextColor3=Color3.fromRGB(255,255,255)
  40. credit.TextScaled=true
  41. credit.TextStrokeTransparency=0.5
  42. credit.TextWrapped=true
  43. credit.TextXAlignment=Enum.TextXAlignment.Left
  44. local main=Instance.new("Frame",scrg)
  45. main.BackgroundColor3=Color3.fromRGB(0,0,0)
  46. main.BackgroundTransparency=0.5
  47. main.BorderColor3=col
  48. main.BorderSizePixel=5
  49. main.Position=UDim2.new(0,0,0.5,-100)
  50. main.Size=UDim2.new(0,300,0,90)
  51. main.Selectable=true
  52. main.Draggable=true
  53. local loopcol=Instance.new("Frame",main)
  54. loopcol.BackgroundTransparency=1
  55. loopcol.Size=UDim2.new(1,0,0.2,0)
  56. local ltitle=Instance.new("TextLabel",loopcol)
  57. ltitle.BackgroundColor3=Color3.fromRGB(255,255,255)
  58. ltitle.BackgroundTransparency=1
  59. ltitle.Size=UDim2.new(1,0,1,0)
  60. ltitle.Font=font
  61. ltitle.FontSize=Enum.FontSize.Size18
  62. ltitle.Text="Looped"
  63. ltitle.TextColor3=col
  64. ltitle.TextXAlignment=Enum.TextXAlignment.Left
  65. ltitle.Active=false
  66. local ltrue=Instance.new("TextButton",loopcol)
  67. ltrue.BackgroundColor3=Color3.fromRGB(0,0,0)
  68. ltrue.BackgroundTransparency=0.5
  69. ltrue.BorderSizePixel=0
  70. ltrue.Position=UDim2.new(0.5,0,0,0)
  71. ltrue.Size=UDim2.new(0.25,0,1,0)
  72. ltrue.Font=font
  73. ltrue.FontSize=Enum.FontSize.Size18
  74. ltrue.Text="true"
  75. ltrue.TextColor3=Color3.fromRGB(255,255,255)
  76. local lfalse=Instance.new("TextButton",loopcol)
  77. lfalse.Name="TextButton2"
  78. lfalse.BackgroundColor3=Color3.fromRGB(0,0,0)
  79. lfalse.BackgroundTransparency=0.5
  80. lfalse.BorderSizePixel=0
  81. lfalse.Position=UDim2.new(0.75,0,0,0)
  82. lfalse.Size=UDim2.new(0.25,0,1,0)
  83. lfalse.Font=font
  84. lfalse.FontSize=Enum.FontSize.Size18
  85. lfalse.Text="false"
  86. lfalse.TextColor3=Color3.fromRGB(255,255,255)
  87. local pscol=Instance.new("Frame",main)
  88. pscol.Name="Frame2"
  89. pscol.BackgroundTransparency=1
  90. pscol.Position=UDim2.new(0,0,0.2,0)
  91. pscol.Size=UDim2.new(1,0,0.2,0)
  92. local pstitle=Instance.new("TextLabel",pscol)
  93. pstitle.BackgroundTransparency=1
  94. pstitle.Size=UDim2.new(1,0,1,0)
  95. pstitle.Font=font
  96. pstitle.FontSize=Enum.FontSize.Size18
  97. pstitle.Text="PlaybackSpeed"
  98. pstitle.TextColor3=col
  99. pstitle.TextXAlignment=Enum.TextXAlignment.Left
  100. pstitle.Active=false
  101. local psfield=Instance.new("TextBox",pscol)
  102. psfield.BackgroundColor3=Color3.fromRGB(0,0,0)
  103. psfield.BackgroundTransparency=0.5
  104. psfield.BorderSizePixel=0
  105. psfield.Position=UDim2.new(0.5,0,0,0)
  106. psfield.Size=UDim2.new(0.5,0,1,0)
  107. psfield.Font=font
  108. psfield.FontSize=Enum.FontSize.Size18
  109. psfield.Text="Input Here"
  110. psfield.TextColor3=Color3.fromRGB(255,255,255)
  111. local sidcol=Instance.new("Frame",main)
  112. sidcol.Name="Frame3"
  113. sidcol.BackgroundTransparency=1
  114. sidcol.Position=UDim2.new(0,0,0.4,0)
  115. sidcol.Size=UDim2.new(1,0,0.2,0)
  116. local sidtitle=Instance.new("TextLabel",sidcol)
  117. sidtitle.BackgroundColor3=Color3.fromRGB(255,255,255)
  118. sidtitle.BackgroundTransparency=1
  119. sidtitle.Size=UDim2.new(1,0,1,0)
  120. sidtitle.Font=font
  121. sidtitle.FontSize=Enum.FontSize.Size18
  122. sidtitle.Text="SoundId"
  123. sidtitle.TextColor3=col
  124. sidtitle.TextXAlignment=Enum.TextXAlignment.Left
  125. sidtitle.Active=false
  126. local sidfield=Instance.new("TextBox",sidcol)
  127. sidfield.BackgroundColor3=Color3.fromRGB(0,0,0)
  128. sidfield.BackgroundTransparency=0.5
  129. sidfield.BorderSizePixel=0
  130. sidfield.Position=UDim2.new(0.5,0,0,0)
  131. sidfield.Size=UDim2.new(0.5,0,1,0)
  132. sidfield.Font=font
  133. sidfield.FontSize=Enum.FontSize.Size18
  134. sidfield.Text="Input Here"
  135. sidfield.TextColor3=Color3.fromRGB(255,255,255)
  136. local volucol=Instance.new("Frame",main)
  137. volucol.Name="Frame4"
  138. volucol.BackgroundColor3=Color3.new(1,1,1)
  139. volucol.BackgroundTransparency=1
  140. volucol.Position=UDim2.new(0,0,0.6,0)
  141. volucol.Size=UDim2.new(1,0,0.2,0)
  142. local volutitle=Instance.new("TextLabel",volucol)
  143. volutitle.BackgroundColor3=Color3.fromRGB(255,255,255)
  144. volutitle.BackgroundTransparency=1
  145. volutitle.Size=UDim2.new(1,0,1,0)
  146. volutitle.Font=font
  147. volutitle.FontSize=Enum.FontSize.Size18
  148. volutitle.Text="Volume"
  149. volutitle.TextColor3=col
  150. volutitle.TextXAlignment=Enum.TextXAlignment.Left
  151. volutitle.Active=false
  152. local volufield= Instance.new("TextBox",volucol)
  153. volufield.BackgroundColor3=Color3.fromRGB(0,0,0)
  154. volufield.BackgroundTransparency=0.5
  155. volufield.BorderSizePixel=0
  156. volufield.Position=UDim2.new(0.5,0,0,0)
  157. volufield.Size=UDim2.new(0.5,0,1,0)
  158. volufield.Font=font
  159. volufield.FontSize=Enum.FontSize.Size18
  160. volufield.Text="Input Here"
  161. volufield.TextColor3=Color3.fromRGB(255,255,255)
  162. local control=Instance.new("Frame",main)
  163. control.Name="Frame5"
  164. control.BackgroundColor3=Color3.fromRGB(255,255,255)
  165. control.BackgroundTransparency=1
  166. control.Position=UDim2.new(0,0,0.8,0)
  167. control.Size=UDim2.new(1,0,0.2,0)
  168. local pleh=Instance.new("TextButton",control)
  169. pleh.BackgroundColor3=Color3.fromRGB(0,0,0)
  170. pleh.BackgroundTransparency=0.5
  171. pleh.BorderSizePixel=0
  172. pleh.Size=UDim2.new(0.5,0,1,0)
  173. pleh.Font=font
  174. pleh.FontSize=Enum.FontSize.Size18
  175. pleh.Text="Play Music"
  176. pleh.TextColor3=Color3.fromRGB(255,255,255)
  177. local stahp=Instance.new("TextButton",control)
  178. stahp.Name="TextButton2"
  179. stahp.BackgroundColor3=Color3.fromRGB(0,0,0)
  180. stahp.BackgroundTransparency=0.5
  181. stahp.BorderSizePixel=0
  182. stahp.Position=UDim2.new(0.5, 0, 0, 0)
  183. stahp.Size=UDim2.new(0.5, 0, 1, 0)
  184. stahp.Font=font
  185. stahp.FontSize=Enum.FontSize.Size18
  186. stahp.Text="Stop Music"
  187. stahp.TextColor3=Color3.fromRGB(255,255,255)
  188. -- yay! creation is finished!
  189. -- but wait... ...there's more...
  190.  
  191. -- this is the fun part...
  192.  
  193. -- define looped variable
  194. looped=true
  195.  
  196. function create()
  197. local sound=Instance.new("Sound",workspace)
  198. sound.Name="MusicGUIsong"
  199. end
  200.  
  201. function del()
  202. if workspace.MusicGUIsong.IsPlaying==true then
  203. workspace.MusicGUIsong:Destroy()
  204. end
  205. end
  206.  
  207. function informii()
  208. local doublecheckplayer=game.Players.LocalPlayer.Name
  209. local wp=workspace:findFirstChild(doublecheckplayer)
  210. local hed=wp.Head
  211. local b=Instance.new("BillboardGui",hed)
  212. b.StudsOffset=Vector3.new(0,4,0)
  213. b.Size=UDim2.new(18,0,4,0)
  214. b.Adornee=hed
  215. local t=Instance.new("TextLabel",b)
  216. t.BackgroundTransparency=1
  217. t.TextColor3=col
  218. t.Text=[[SoundId playing: ]]..sidfield.Text..[[
  219. PlaybackSpeed: ]]..psfield.Text..[[
  220. Volume: ]]..volufield.Text
  221. t.Font=font
  222. t.Size=UDim2.new(1,0,1,0)
  223. t.TextScaled=true
  224. wait(5)
  225. t:Destroy()
  226. end
  227.  
  228. --[[function custom(texts) -- custom notification (UNUSED)
  229. local hed=workspace:findFirstChild(Player).Head
  230. local b=Instance.new("BillboardGui",hed)
  231. b.StudsOffset=Vector3.new(0,4,0)
  232. b.Size=UDim2.new(18,0,2,0)
  233. b.Adornee=hed
  234. local t=Instance.new("TextLabel",b)
  235. t.BackgroundTransparency=1
  236. t.TextColor3=col
  237. t.Text=texts
  238. t.Font=font
  239. t.Size=UDim2.new(1,0,1,0)
  240. wait(5)
  241. t:Destroy()
  242. end]]
  243.  
  244. ltrue.MouseButton1Click:connect(function()
  245. looped=true
  246. end)
  247. lfalse.MouseButton1Click:connect(function()
  248. looped=false
  249. end)
  250. pleh.MouseButton1Click:connect(function()
  251. create()
  252. workspace.MusicGUIsong.Looped=looped
  253. workspace.MusicGUIsong.PlaybackSpeed=psfield.Text
  254. workspace.MusicGUIsong.SoundId="rbxassetid://"..sidfield.Text
  255. workspace.MusicGUIsong.Volume=volufield.Text
  256. workspace.MusicGUIsong:Play()
  257. informii()
  258. end)
  259. stahp.MouseButton1Click:connect(function()
  260. del()
  261. end)
  262.  
  263. --custom("adchand2's music player 1.2.0 is now prepared")
  264. print("adchand2's music player 1.2.0 is at the end!")
  265. print(_VERSION.." is cool!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement