Advertisement
killerboy634

ddmuisc

Feb 27th, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. --//music gui made in like 10 minutes by sweg2hip lolz
  2. local gui = Instance.new("ScreenGui",game.Players.LocalPlayer.PlayerGui)
  3. gui.Name = "MusicGui"
  4. local frm = Instance.new("Frame", gui)
  5. frm.Name = "Main"
  6. frm.Visible = false
  7. frm.Active = true
  8. frm.Draggable = true
  9. frm.Position = UDim2.new(0.5, -150, 0.5, -150)
  10. frm.Size = UDim2.new(0,300,0,300)
  11. frm.BackgroundColor3 = Color3.new(255, 0, 0)
  12. frm.BackgroundTransparency = 0.4
  13. frm.BorderSizePixel = 0
  14. local id = Instance.new("TextBox", frm)
  15. id.Text = "ID"
  16. id.Size = UDim2.new(0, 250, 0, 50)
  17. id.Position = UDim2.new(0.5, -125, 0, 20)
  18. id.BorderSizePixel = 0
  19. id.BackgroundTransparency = 0.6
  20. local play = Instance.new("TextButton", frm)
  21. play.Text = "PLAY"
  22. play.Size = UDim2.new(0, 250, 0, 50)
  23. play.Position = UDim2.new(0.5, -125, 0, 130)
  24. play.BorderSizePixel = 0
  25. play.BackgroundTransparency = 0.6
  26. local stop = Instance.new("TextButton", frm)
  27. stop.Text = "STOP"
  28. stop.Size = UDim2.new(0, 250, 0, 50)
  29. stop.Position = UDim2.new(0.5, -125, 0, 230)
  30. stop.BorderSizePixel = 0
  31. stop.BackgroundTransparency = 0.6
  32.  
  33. function stopsounds()
  34. for i,v in pairs(game.Workspace:GetChildren()) do
  35. if v:IsA("Sound") then
  36. v:remove()
  37. end
  38. end
  39. end
  40.  
  41. function playsound(id)
  42. stopsounds()
  43. wait()
  44. local h = Instance.new("Sound",workspace)
  45. h.Name = "MusicGuiP"
  46. h.SoundId = "rbxassetid://"..id
  47. h.Volume = 2
  48. h.Looped = true
  49. h:Play()
  50. end
  51.  
  52. play.MouseButton1Down:connect(function()
  53. local sid = id.Text
  54. playsound(sid)
  55. end)
  56.  
  57. stop.MouseButton1Down:connect(function()
  58. stopsounds()
  59. end)
  60. mse = game.Players.LocalPlayer:GetMouse()
  61. mse.KeyDown:connect(function(key)
  62. if key:lower() == "m" then
  63. if frm.Visible == false then
  64. frm.Visible = true
  65. else
  66. frm.Visible = false
  67. end
  68. end
  69. end)
  70. local h = Instance.new("Hint",game.Players.LocalPlayer.PlayerGui)
  71. h.Text = "Press 'm' to open/close the gui!"
  72. wait(2)
  73. h:remove()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement