Advertisement
sleepyfun

Sleepyfun's Music Player

Nov 23rd, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.25 KB | None | 0 0
  1. -- Objects
  2.  
  3. local SFmusic = Instance.new("ScreenGui")
  4. local Container = Instance.new("Frame")
  5. local MusicPlayer = Instance.new("Frame")
  6. local IdBox = Instance.new("TextBox")
  7. local IdLabel = Instance.new("TextLabel")
  8. local VolLabel = Instance.new("TextLabel")
  9. local VolBox = Instance.new("TextBox")
  10. local PitchLabel = Instance.new("TextLabel")
  11. local PitchBox = Instance.new("TextBox")
  12. local PlayButton = Instance.new("TextButton")
  13. local StopButton = Instance.new("TextButton")
  14. local Topbar = Instance.new("Frame")
  15. local Title = Instance.new("TextLabel")
  16. local MinimiseButton = Instance.new("TextButton")
  17. local SoundObject = Instance.new("Sound")
  18. local MinimiseToggle = false
  19.  
  20. -- Properties
  21.  
  22. SFmusic.Name = "SFmusic"
  23. SFmusic.Parent = game.Players.LocalPlayer.PlayerGui
  24.  
  25. Container.Name = "Container"
  26. Container.Parent = SFmusic
  27. Container.Active = true
  28. Container.BackgroundColor3 = Color3.new(1, 1, 1)
  29. Container.BackgroundTransparency = 1
  30. Container.Draggable = true
  31. Container.Size = UDim2.new(0, 200, 0, 170)
  32.  
  33. MusicPlayer.Name = "MusicPlayer"
  34. MusicPlayer.Parent = Container
  35. MusicPlayer.Active = true
  36. MusicPlayer.BackgroundColor3 = Color3.new(0.258824, 0.258824, 0.258824)
  37. MusicPlayer.BorderSizePixel = 0
  38. MusicPlayer.Position = UDim2.new(0, 0, 0, 20)
  39. MusicPlayer.Size = UDim2.new(0, 200, 0, 150)
  40.  
  41. IdBox.Name = "IdBox"
  42. IdBox.Parent = MusicPlayer
  43. IdBox.BackgroundColor3 = Color3.new(1, 1, 1)
  44. IdBox.BorderSizePixel = 0
  45. IdBox.Position = UDim2.new(0, 70, 0, 16)
  46. IdBox.Size = UDim2.new(0, 119, 0, 21)
  47. IdBox.Font = Enum.Font.SourceSans
  48. IdBox.FontSize = Enum.FontSize.Size14
  49. IdBox.Text = "682332680"
  50. IdBox.TextSize = 14
  51.  
  52. IdLabel.Name = "IdLabel"
  53. IdLabel.Parent = MusicPlayer
  54. IdLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  55. IdLabel.BackgroundTransparency = 1
  56. IdLabel.BorderSizePixel = 0
  57. IdLabel.Position = UDim2.new(0, 6, 0, 16)
  58. IdLabel.Size = UDim2.new(0, 64, 0, 21)
  59. IdLabel.Font = Enum.Font.SourceSansBold
  60. IdLabel.FontSize = Enum.FontSize.Size14
  61. IdLabel.Text = "ID:"
  62. IdLabel.TextColor3 = Color3.new(1, 1, 1)
  63. IdLabel.TextScaled = true
  64. IdLabel.TextSize = 14
  65. IdLabel.TextWrapped = true
  66.  
  67. VolLabel.Name = "VolLabel"
  68. VolLabel.Parent = MusicPlayer
  69. VolLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  70. VolLabel.BackgroundTransparency = 1
  71. VolLabel.BorderSizePixel = 0
  72. VolLabel.Position = UDim2.new(0, 6, 0, 43)
  73. VolLabel.Size = UDim2.new(0, 64, 0, 21)
  74. VolLabel.Font = Enum.Font.SourceSansBold
  75. VolLabel.FontSize = Enum.FontSize.Size18
  76. VolLabel.Text = "Volume:"
  77. VolLabel.TextColor3 = Color3.new(1, 1, 1)
  78. VolLabel.TextSize = 18
  79. VolLabel.TextWrapped = true
  80.  
  81. VolBox.Name = "VolBox"
  82. VolBox.Parent = MusicPlayer
  83. VolBox.BackgroundColor3 = Color3.new(1, 1, 1)
  84. VolBox.BorderSizePixel = 0
  85. VolBox.Position = UDim2.new(0, 70, 0, 43)
  86. VolBox.Size = UDim2.new(0, 119, 0, 21)
  87. VolBox.Font = Enum.Font.SourceSans
  88. VolBox.FontSize = Enum.FontSize.Size14
  89. VolBox.Text = "10"
  90. VolBox.TextSize = 14
  91.  
  92. PitchLabel.Name = "PitchLabel"
  93. PitchLabel.Parent = MusicPlayer
  94. PitchLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  95. PitchLabel.BackgroundTransparency = 1
  96. PitchLabel.BorderSizePixel = 0
  97. PitchLabel.Position = UDim2.new(0, 6, 0, 72)
  98. PitchLabel.Size = UDim2.new(0, 64, 0, 21)
  99. PitchLabel.Font = Enum.Font.SourceSansBold
  100. PitchLabel.FontSize = Enum.FontSize.Size24
  101. PitchLabel.Text = "Pitch:"
  102. PitchLabel.TextColor3 = Color3.new(1, 1, 1)
  103. PitchLabel.TextSize = 23
  104. PitchLabel.TextWrapped = true
  105.  
  106. PitchBox.Name = "PitchBox"
  107. PitchBox.Parent = MusicPlayer
  108. PitchBox.BackgroundColor3 = Color3.new(1, 1, 1)
  109. PitchBox.BorderSizePixel = 0
  110. PitchBox.Position = UDim2.new(0, 70, 0, 72)
  111. PitchBox.Size = UDim2.new(0, 119, 0, 21)
  112. PitchBox.Font = Enum.Font.SourceSans
  113. PitchBox.FontSize = Enum.FontSize.Size14
  114. PitchBox.Text = "1"
  115. PitchBox.TextSize = 14
  116.  
  117. PlayButton.Name = "PlayButton"
  118. PlayButton.Parent = MusicPlayer
  119. PlayButton.BackgroundColor3 = Color3.new(1, 1, 1)
  120. PlayButton.BorderSizePixel = 0
  121. PlayButton.Position = UDim2.new(0, 12, 0, 106)
  122. PlayButton.Size = UDim2.new(0, 81, 0, 24)
  123. PlayButton.Font = Enum.Font.SourceSans
  124. PlayButton.FontSize = Enum.FontSize.Size14
  125. PlayButton.Text = "Play"
  126. PlayButton.TextSize = 14
  127.  
  128. StopButton.Name = "StopButton"
  129. StopButton.Parent = MusicPlayer
  130. StopButton.BackgroundColor3 = Color3.new(1, 1, 1)
  131. StopButton.BorderSizePixel = 0
  132. StopButton.Position = UDim2.new(0, 108, 0, 106)
  133. StopButton.Size = UDim2.new(0, 81, 0, 24)
  134. StopButton.Font = Enum.Font.SourceSans
  135. StopButton.FontSize = Enum.FontSize.Size14
  136. StopButton.Text = "Stop"
  137. StopButton.TextSize = 14
  138.  
  139. Topbar.Name = "Topbar"
  140. Topbar.Parent = Container
  141. Topbar.BackgroundColor3 = Color3.new(0.113725, 0.113725, 0.113725)
  142. Topbar.BorderSizePixel = 0
  143. Topbar.Size = UDim2.new(0, 200, 0, 20)
  144.  
  145. Title.Name = "Title"
  146. Title.Parent = Topbar
  147. Title.BackgroundColor3 = Color3.new(1, 1, 1)
  148. Title.BackgroundTransparency = 1
  149. Title.BorderSizePixel = 0
  150. Title.Position = UDim2.new(0, 5, 0, 0)
  151. Title.Size = UDim2.new(1, -25, 1, 0)
  152. Title.Font = Enum.Font.SourceSans
  153. Title.FontSize = Enum.FontSize.Size14
  154. Title.Text = " Sleepyfun's Music player"
  155. Title.TextColor3 = Color3.new(1, 1, 1)
  156. Title.TextSize = 14
  157. Title.TextXAlignment = Enum.TextXAlignment.Left
  158.  
  159. MinimiseButton.Name = "MinimiseButton"
  160. MinimiseButton.Parent = Topbar
  161. MinimiseButton.BackgroundColor3 = Color3.new(1, 1, 1)
  162. MinimiseButton.BackgroundTransparency = 1
  163. MinimiseButton.Position = UDim2.new(1, -20, 0, 0)
  164. MinimiseButton.Size = UDim2.new(0, 20, 0, 20)
  165. MinimiseButton.Font = Enum.Font.SourceSans
  166. MinimiseButton.FontSize = Enum.FontSize.Size18
  167. MinimiseButton.Text = "-"
  168. MinimiseButton.TextColor3 = Color3.new(1, 1, 1)
  169. MinimiseButton.TextScaled = true
  170. MinimiseButton.TextSize = 17
  171. MinimiseButton.TextStrokeTransparency = 5
  172. MinimiseButton.TextWrapped = true
  173.  
  174. SoundObject.Parent = game.Workspace
  175.  
  176. -- Functions
  177.  
  178. PlayButton.MouseButton1Click:connect(function()
  179.     SoundObject.SoundId = "rbxassetid://"..IdBox.Text
  180.     SoundObject.Pitch = PitchBox.Text
  181.     SoundObject.Volume = VolBox.Text
  182.     SoundObject.Looped = true
  183.     SoundObject:Play()
  184. end)
  185.  
  186. StopButton.MouseButton1Click:connect(function()
  187.     SoundObject:Stop()
  188. end)
  189.  
  190. MinimiseButton.MouseButton1Click:connect(function()
  191.     if MinimiseToggle == false then
  192.         MinimiseButton.Text = "+"
  193.         MusicPlayer.Visible = false
  194.         MinimiseToggle = true
  195.     else
  196.         MinimiseButton.Text = "-"
  197.         MusicPlayer.Visible = true
  198.         MinimiseToggle = false
  199.     end
  200. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement