Advertisement
Migas3456

Music Gui

Sep 26th, 2017
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.35 KB | None | 0 0
  1. -- Objects
  2.  
  3. local ScreenGui = Instance.new("ScreenGui")
  4. local Frame = Instance.new("Frame")
  5. local TextLabel = Instance.new("TextLabel")
  6. local TextBox = Instance.new("TextBox")
  7. local TextBox_2 = Instance.new("TextBox")
  8. local TextLabel_2 = Instance.new("TextLabel")
  9. local TextLabel_3 = Instance.new("TextLabel")
  10. local TextButton = Instance.new("TextButton")
  11. local TextButton_2 = Instance.new("TextButton")
  12.  
  13. -- Properties
  14.  
  15. if game.PlaceId == "843495510,843468296" then
  16. ScreenGui.Parent = game.Players.LocalPlayer.PlayerGui
  17. ScreenGui.ResetOnSpawn = false
  18. else
  19. ScreenGui.Parent = game.CoreGui
  20. end
  21.  
  22. Frame.Parent = ScreenGui
  23. Frame.BackgroundColor3 = Color3.new(0.454902, 0.454902, 0.454902)
  24. Frame.BorderColor3 = Color3.new(0, 0.666667, 1)
  25. Frame.Position = UDim2.new(0, 0, 0, 243)
  26. Frame.Size = UDim2.new(0, 408, 0, 312)
  27.  
  28. TextLabel.Parent = Frame
  29. TextLabel.BackgroundColor3 = Color3.new(0.454902, 0.454902, 0.454902)
  30. TextLabel.BorderColor3 = Color3.new(0, 0.666667, 1)
  31. TextLabel.Size = UDim2.new(0, 408, 0, 50)
  32. TextLabel.Font = Enum.Font.SourceSans
  33. TextLabel.FontSize = Enum.FontSize.Size14
  34. TextLabel.Text = "Music GUI By Migas3456"
  35. TextLabel.TextColor3 = Color3.new(0, 0.666667, 1)
  36. TextLabel.TextScaled = true
  37. TextLabel.TextSize = 14
  38. TextLabel.TextWrapped = true
  39.  
  40. TextBox.Parent = Frame
  41. TextBox.BackgroundColor3 = Color3.new(1, 1, 1)
  42. TextBox.Position = UDim2.new(0, 104, 0, 71)
  43. TextBox.Size = UDim2.new(0, 200, 0, 27)
  44. TextBox.Font = Enum.Font.SourceSans
  45. TextBox.FontSize = Enum.FontSize.Size14
  46. TextBox.Text = "hi"
  47. TextBox.TextSize = 14
  48.  
  49. TextBox_2.Parent = Frame
  50. TextBox_2.BackgroundColor3 = Color3.new(1, 1, 1)
  51. TextBox_2.Position = UDim2.new(0, 104, 0, 113)
  52. TextBox_2.Size = UDim2.new(0, 200, 0, 27)
  53. TextBox_2.Font = Enum.Font.SourceSans
  54. TextBox_2.FontSize = Enum.FontSize.Size14
  55. TextBox_2.Text = "bye"
  56. TextBox_2.TextSize = 14
  57.  
  58. TextLabel_2.Parent = Frame
  59. TextLabel_2.BackgroundColor3 = Color3.new(1, 1, 1)
  60. TextLabel_2.BackgroundTransparency = 1
  61. TextLabel_2.Position = UDim2.new(0, 0, 0, 59)
  62. TextLabel_2.Size = UDim2.new(0, 92, 0, 50)
  63. TextLabel_2.Font = Enum.Font.SourceSans
  64. TextLabel_2.FontSize = Enum.FontSize.Size14
  65. TextLabel_2.Text = "Song ID:"
  66. TextLabel_2.TextColor3 = Color3.new(0, 0.666667, 1)
  67. TextLabel_2.TextScaled = true
  68. TextLabel_2.TextSize = 14
  69. TextLabel_2.TextWrapped = true
  70.  
  71. TextLabel_3.Parent = Frame
  72. TextLabel_3.BackgroundColor3 = Color3.new(1, 1, 1)
  73. TextLabel_3.BackgroundTransparency = 1
  74. TextLabel_3.Position = UDim2.new(0, 0, 0, 95)
  75. TextLabel_3.Size = UDim2.new(0, 92, 0, 61)
  76. TextLabel_3.Font = Enum.Font.SourceSans
  77. TextLabel_3.FontSize = Enum.FontSize.Size14
  78. TextLabel_3.Text = "Volume:"
  79. TextLabel_3.TextColor3 = Color3.new(0, 0.666667, 1)
  80. TextLabel_3.TextScaled = true
  81. TextLabel_3.TextSize = 14
  82. TextLabel_3.TextWrapped = true
  83.  
  84. TextButton.Parent = Frame
  85. TextButton.BackgroundColor3 = Color3.new(1, 1, 1)
  86. TextButton.Position = UDim2.new(0, 104, 0, 209)
  87. TextButton.Size = UDim2.new(0, 200, 0, 39)
  88. TextButton.Font = Enum.Font.SourceSans
  89. TextButton.FontSize = Enum.FontSize.Size14
  90. TextButton.Text = "PLAY"
  91. TextButton.TextSize = 14
  92.  
  93. --[[Function/s being made!]]
  94. function PlayMusic(ID)
  95. for i, v in pairs (game.Workspace:GetChildren()) do
  96. if v:IsA("Sound") then
  97. v:Remove()
  98. end
  99. end
  100. local music = Instance.new("Sound")
  101. local asset = "rbxassetid://"
  102. music.SoundId = asset .. ID
  103. music.Parent = workspace
  104. music.Volume = (TextBox_2.Text)
  105. music.Looped = true
  106. music:Play()
  107. end
  108. --[[Connecting functions!]]
  109. TextButton.MouseButton1Down:connect(function()
  110. PlayMusic(TextBox.Text)
  111. end)
  112.  
  113. TextButton_2.Parent = Frame
  114. TextButton_2.BackgroundColor3 = Color3.new(1, 1, 1)
  115. TextButton_2.Position = UDim2.new(0, 104, 0, 256)
  116. TextButton_2.Size = UDim2.new(0, 200, 0, 39)
  117. TextButton_2.Font = Enum.Font.SourceSans
  118. TextButton_2.FontSize = Enum.FontSize.Size14
  119. TextButton_2.Text = "STOP"
  120. TextButton_2.TextSize = 14
  121.  
  122. --[[Function/s being made!]]
  123. function PlayMusic(ID)
  124. for i, v in pairs (game.Workspace:GetChildren()) do
  125. if v:IsA("Sound") then
  126. v:Remove()
  127. end
  128. end
  129. local music = Instance.new("Sound")
  130. local asset = "rbxassetid://"
  131. music.SoundId = asset .. ID
  132. music.Parent = workspace
  133. music.Volume = (TextBox_2.Text)
  134. music.Looped = true
  135. music:Play()
  136. end
  137. --[[Connecting functions!]]
  138. TextButton_2.MouseButton1Down:connect(function()
  139. PlayMusic(0)
  140. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement