Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local SoundEvent = ReplicatedStorage:WaitForChild("SoundEvent")
- --
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
- --
- local Frame = Instance.new("Frame")
- Frame.Size = UDim2.new(0, 300, 0, 250)
- Frame.Position = UDim2.new(0.5, -150, 0.5, -125)
- Frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- Frame.BackgroundTransparency = 0.1
- Frame.BorderSizePixel = 0
- Frame.Parent = ScreenGui
- --
- Frame.Active = true
- Frame.Draggable = true
- --
- local UICorner = Instance.new("UICorner")
- UICorner.CornerRadius = UDim.new(0, 10)
- UICorner.Parent = Frame
- --
- local Title = Instance.new("TextLabel")
- Title.Size = UDim2.new(1, 0, 0, 30)
- Title.BackgroundTransparency = 1
- Title.Text = "🎵 Music Player v3"
- Title.TextColor3 = Color3.fromRGB(255, 255, 255)
- Title.TextScaled = true
- Title.Parent = Frame
- --
- local SoundBox = Instance.new("TextBox")
- SoundBox.Size = UDim2.new(0, 250, 0, 35)
- SoundBox.Position = UDim2.new(0.5, -125, 0, 40)
- SoundBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- SoundBox.TextColor3 = Color3.fromRGB(255, 255, 255)
- SoundBox.PlaceholderText = "Enter Sound ID..."
- SoundBox.Parent = Frame
- --
- local PitchBox = Instance.new("TextBox")
- PitchBox.Size = UDim2.new(0, 250, 0, 35)
- PitchBox.Position = UDim2.new(0.5, -125, 0, 80)
- PitchBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- PitchBox.TextColor3 = Color3.fromRGB(255, 255, 255)
- PitchBox.PlaceholderText = "Enter Pitch (1 = Normal)..."
- PitchBox.Parent = Frame
- --
- local UIGradient = Instance.new("UIGradient")
- UIGradient.Color = ColorSequence.new{
- ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 120, 120)),
- ColorSequenceKeypoint.new(1, Color3.fromRGB(120, 120, 255))
- }
- UIGradient.Parent = Frame
- --
- local function CreateButton(name, text, pos, color)
- local Button = Instance.new("TextButton")
- Button.Size = UDim2.new(0, 110, 0, 40)
- Button.Position = pos
- Button.BackgroundColor3 = color
- Button.TextColor3 = Color3.fromRGB(255, 255, 255)
- Button.Text = text
- Button.Font = Enum.Font.SourceSansBold
- Button.TextScaled = true
- Button.Parent = Frame
- local ButtonCorner = Instance.new("UICorner")
- ButtonCorner.CornerRadius = UDim.new(0, 8)
- ButtonCorner.Parent = Button
- return Button
- end
- --
- local PlayButton = CreateButton("PlayButton", "▶ Play", UDim2.new(0.5, -125, 0, 130), Color3.fromRGB(0, 200, 0))
- local StopButton = CreateButton("StopButton", "⏹ Stop", UDim2.new(0.5, 15, 0, 130), Color3.fromRGB(200, 0, 0))
- local PitchButton = CreateButton("PitchButton", "⚡ Change Pitch", UDim2.new(0.5, -55, 0, 180), Color3.fromRGB(0, 120, 255))
- --
- local Sound = Instance.new("Sound")
- Sound.Parent = game:GetService("Workspace")
- Sound.Looped = true
- Sound.Volume = 3 -- Adjust volume if needed
- --
- PlayButton.MouseButton1Click:Connect(function()
- local soundID = SoundBox.Text
- local pitch = tonumber(PitchBox.Text) or 1
- if soundID ~= "" then
- Sound.SoundId = "rbxassetid://" .. soundID
- Sound.PlaybackSpeed = pitch
- Sound:Play()
- end
- end)
- --
- StopButton.MouseButton1Click:Connect(function()
- Sound:Stop()
- end)
- --
- PitchButton.MouseButton1Click:Connect(function()
- local pitch = tonumber(PitchBox.Text) or 1
- Sound.PlaybackSpeed = pitch
- end)
Advertisement
Add Comment
Please, Sign In to add comment