Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Objects
- local SFmusic = Instance.new("ScreenGui")
- local Container = Instance.new("Frame")
- local MusicPlayer = Instance.new("Frame")
- local IdBox = Instance.new("TextBox")
- local IdLabel = Instance.new("TextLabel")
- local VolLabel = Instance.new("TextLabel")
- local VolBox = Instance.new("TextBox")
- local PitchLabel = Instance.new("TextLabel")
- local PitchBox = Instance.new("TextBox")
- local PlayButton = Instance.new("TextButton")
- local StopButton = Instance.new("TextButton")
- local Topbar = Instance.new("Frame")
- local Title = Instance.new("TextLabel")
- local MinimiseButton = Instance.new("TextButton")
- local SoundObject = Instance.new("Sound")
- local MinimiseToggle = false
- -- Properties
- SFmusic.Name = "SFmusic"
- SFmusic.Parent = game.Players.LocalPlayer.PlayerGui
- Container.Name = "Container"
- Container.Parent = SFmusic
- Container.Active = true
- Container.BackgroundColor3 = Color3.new(1, 1, 1)
- Container.BackgroundTransparency = 1
- Container.Draggable = true
- Container.Size = UDim2.new(0, 200, 0, 170)
- MusicPlayer.Name = "MusicPlayer"
- MusicPlayer.Parent = Container
- MusicPlayer.Active = true
- MusicPlayer.BackgroundColor3 = Color3.new(0.258824, 0.258824, 0.258824)
- MusicPlayer.BorderSizePixel = 0
- MusicPlayer.Position = UDim2.new(0, 0, 0, 20)
- MusicPlayer.Size = UDim2.new(0, 200, 0, 150)
- IdBox.Name = "IdBox"
- IdBox.Parent = MusicPlayer
- IdBox.BackgroundColor3 = Color3.new(1, 1, 1)
- IdBox.BorderSizePixel = 0
- IdBox.Position = UDim2.new(0, 70, 0, 16)
- IdBox.Size = UDim2.new(0, 119, 0, 21)
- IdBox.Font = Enum.Font.SourceSans
- IdBox.FontSize = Enum.FontSize.Size14
- IdBox.Text = "682332680"
- IdBox.TextSize = 14
- IdLabel.Name = "IdLabel"
- IdLabel.Parent = MusicPlayer
- IdLabel.BackgroundColor3 = Color3.new(1, 1, 1)
- IdLabel.BackgroundTransparency = 1
- IdLabel.BorderSizePixel = 0
- IdLabel.Position = UDim2.new(0, 6, 0, 16)
- IdLabel.Size = UDim2.new(0, 64, 0, 21)
- IdLabel.Font = Enum.Font.SourceSansBold
- IdLabel.FontSize = Enum.FontSize.Size14
- IdLabel.Text = "ID:"
- IdLabel.TextColor3 = Color3.new(1, 1, 1)
- IdLabel.TextScaled = true
- IdLabel.TextSize = 14
- IdLabel.TextWrapped = true
- VolLabel.Name = "VolLabel"
- VolLabel.Parent = MusicPlayer
- VolLabel.BackgroundColor3 = Color3.new(1, 1, 1)
- VolLabel.BackgroundTransparency = 1
- VolLabel.BorderSizePixel = 0
- VolLabel.Position = UDim2.new(0, 6, 0, 43)
- VolLabel.Size = UDim2.new(0, 64, 0, 21)
- VolLabel.Font = Enum.Font.SourceSansBold
- VolLabel.FontSize = Enum.FontSize.Size18
- VolLabel.Text = "Volume:"
- VolLabel.TextColor3 = Color3.new(1, 1, 1)
- VolLabel.TextSize = 18
- VolLabel.TextWrapped = true
- VolBox.Name = "VolBox"
- VolBox.Parent = MusicPlayer
- VolBox.BackgroundColor3 = Color3.new(1, 1, 1)
- VolBox.BorderSizePixel = 0
- VolBox.Position = UDim2.new(0, 70, 0, 43)
- VolBox.Size = UDim2.new(0, 119, 0, 21)
- VolBox.Font = Enum.Font.SourceSans
- VolBox.FontSize = Enum.FontSize.Size14
- VolBox.Text = "10"
- VolBox.TextSize = 14
- PitchLabel.Name = "PitchLabel"
- PitchLabel.Parent = MusicPlayer
- PitchLabel.BackgroundColor3 = Color3.new(1, 1, 1)
- PitchLabel.BackgroundTransparency = 1
- PitchLabel.BorderSizePixel = 0
- PitchLabel.Position = UDim2.new(0, 6, 0, 72)
- PitchLabel.Size = UDim2.new(0, 64, 0, 21)
- PitchLabel.Font = Enum.Font.SourceSansBold
- PitchLabel.FontSize = Enum.FontSize.Size24
- PitchLabel.Text = "Pitch:"
- PitchLabel.TextColor3 = Color3.new(1, 1, 1)
- PitchLabel.TextSize = 23
- PitchLabel.TextWrapped = true
- PitchBox.Name = "PitchBox"
- PitchBox.Parent = MusicPlayer
- PitchBox.BackgroundColor3 = Color3.new(1, 1, 1)
- PitchBox.BorderSizePixel = 0
- PitchBox.Position = UDim2.new(0, 70, 0, 72)
- PitchBox.Size = UDim2.new(0, 119, 0, 21)
- PitchBox.Font = Enum.Font.SourceSans
- PitchBox.FontSize = Enum.FontSize.Size14
- PitchBox.Text = "1"
- PitchBox.TextSize = 14
- PlayButton.Name = "PlayButton"
- PlayButton.Parent = MusicPlayer
- PlayButton.BackgroundColor3 = Color3.new(1, 1, 1)
- PlayButton.BorderSizePixel = 0
- PlayButton.Position = UDim2.new(0, 12, 0, 106)
- PlayButton.Size = UDim2.new(0, 81, 0, 24)
- PlayButton.Font = Enum.Font.SourceSans
- PlayButton.FontSize = Enum.FontSize.Size14
- PlayButton.Text = "Play"
- PlayButton.TextSize = 14
- StopButton.Name = "StopButton"
- StopButton.Parent = MusicPlayer
- StopButton.BackgroundColor3 = Color3.new(1, 1, 1)
- StopButton.BorderSizePixel = 0
- StopButton.Position = UDim2.new(0, 108, 0, 106)
- StopButton.Size = UDim2.new(0, 81, 0, 24)
- StopButton.Font = Enum.Font.SourceSans
- StopButton.FontSize = Enum.FontSize.Size14
- StopButton.Text = "Stop"
- StopButton.TextSize = 14
- Topbar.Name = "Topbar"
- Topbar.Parent = Container
- Topbar.BackgroundColor3 = Color3.new(0.113725, 0.113725, 0.113725)
- Topbar.BorderSizePixel = 0
- Topbar.Size = UDim2.new(0, 200, 0, 20)
- Title.Name = "Title"
- Title.Parent = Topbar
- Title.BackgroundColor3 = Color3.new(1, 1, 1)
- Title.BackgroundTransparency = 1
- Title.BorderSizePixel = 0
- Title.Position = UDim2.new(0, 5, 0, 0)
- Title.Size = UDim2.new(1, -25, 1, 0)
- Title.Font = Enum.Font.SourceSans
- Title.FontSize = Enum.FontSize.Size14
- Title.Text = " Sleepyfun's Music player"
- Title.TextColor3 = Color3.new(1, 1, 1)
- Title.TextSize = 14
- Title.TextXAlignment = Enum.TextXAlignment.Left
- MinimiseButton.Name = "MinimiseButton"
- MinimiseButton.Parent = Topbar
- MinimiseButton.BackgroundColor3 = Color3.new(1, 1, 1)
- MinimiseButton.BackgroundTransparency = 1
- MinimiseButton.Position = UDim2.new(1, -20, 0, 0)
- MinimiseButton.Size = UDim2.new(0, 20, 0, 20)
- MinimiseButton.Font = Enum.Font.SourceSans
- MinimiseButton.FontSize = Enum.FontSize.Size18
- MinimiseButton.Text = "-"
- MinimiseButton.TextColor3 = Color3.new(1, 1, 1)
- MinimiseButton.TextScaled = true
- MinimiseButton.TextSize = 17
- MinimiseButton.TextStrokeTransparency = 5
- MinimiseButton.TextWrapped = true
- SoundObject.Parent = game.Workspace
- -- Functions
- PlayButton.MouseButton1Click:connect(function()
- SoundObject.SoundId = "rbxassetid://"..IdBox.Text
- SoundObject.Pitch = PitchBox.Text
- SoundObject.Volume = VolBox.Text
- SoundObject.Looped = true
- SoundObject:Play()
- end)
- StopButton.MouseButton1Click:connect(function()
- SoundObject:Stop()
- end)
- MinimiseButton.MouseButton1Click:connect(function()
- if MinimiseToggle == false then
- MinimiseButton.Text = "+"
- MusicPlayer.Visible = false
- MinimiseToggle = true
- else
- MinimiseButton.Text = "-"
- MusicPlayer.Visible = true
- MinimiseToggle = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement