Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --//music gui made in like 10 minutes by sweg2hip lolz
- local gui = Instance.new("ScreenGui",game.Players.LocalPlayer.PlayerGui)
- gui.Name = "MusicGui"
- local frm = Instance.new("Frame", gui)
- frm.Name = "Main"
- frm.Visible = false
- frm.Active = true
- frm.Draggable = true
- frm.Position = UDim2.new(0.5, -150, 0.5, -150)
- frm.Size = UDim2.new(0,300,0,300)
- frm.BackgroundColor3 = Color3.new(255, 0, 0)
- frm.BackgroundTransparency = 0.4
- frm.BorderSizePixel = 0
- local id = Instance.new("TextBox", frm)
- id.Text = "ID"
- id.Size = UDim2.new(0, 250, 0, 50)
- id.Position = UDim2.new(0.5, -125, 0, 20)
- id.BorderSizePixel = 0
- id.BackgroundTransparency = 0.6
- local play = Instance.new("TextButton", frm)
- play.Text = "PLAY"
- play.Size = UDim2.new(0, 250, 0, 50)
- play.Position = UDim2.new(0.5, -125, 0, 130)
- play.BorderSizePixel = 0
- play.BackgroundTransparency = 0.6
- local stop = Instance.new("TextButton", frm)
- stop.Text = "STOP"
- stop.Size = UDim2.new(0, 250, 0, 50)
- stop.Position = UDim2.new(0.5, -125, 0, 230)
- stop.BorderSizePixel = 0
- stop.BackgroundTransparency = 0.6
- function stopsounds()
- for i,v in pairs(game.Workspace:GetChildren()) do
- if v:IsA("Sound") then
- v:remove()
- end
- end
- end
- function playsound(id)
- stopsounds()
- wait()
- local h = Instance.new("Sound",workspace)
- h.Name = "MusicGuiP"
- h.SoundId = "rbxassetid://"..id
- h.Volume = 2
- h.Looped = true
- h:Play()
- end
- play.MouseButton1Down:connect(function()
- local sid = id.Text
- playsound(sid)
- end)
- stop.MouseButton1Down:connect(function()
- stopsounds()
- end)
- mse = game.Players.LocalPlayer:GetMouse()
- mse.KeyDown:connect(function(key)
- if key:lower() == "m" then
- if frm.Visible == false then
- frm.Visible = true
- else
- frm.Visible = false
- end
- end
- end)
- local h = Instance.new("Hint",game.Players.LocalPlayer.PlayerGui)
- h.Text = "Press 'm' to open/close the gui!"
- wait(2)
- h:remove()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement