Ovovuevuevue

Music player V3

Mar 13th, 2025
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  3. local SoundEvent = ReplicatedStorage:WaitForChild("SoundEvent")
  4.  
  5. --
  6. local ScreenGui = Instance.new("ScreenGui")
  7. ScreenGui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
  8.  
  9. --
  10. local Frame = Instance.new("Frame")
  11. Frame.Size = UDim2.new(0, 300, 0, 250)
  12. Frame.Position = UDim2.new(0.5, -150, 0.5, -125)
  13. Frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  14. Frame.BackgroundTransparency = 0.1
  15. Frame.BorderSizePixel = 0
  16. Frame.Parent = ScreenGui
  17.  
  18. --
  19. Frame.Active = true
  20. Frame.Draggable = true
  21.  
  22. --
  23. local UICorner = Instance.new("UICorner")
  24. UICorner.CornerRadius = UDim.new(0, 10)
  25. UICorner.Parent = Frame
  26.  
  27. --
  28. local Title = Instance.new("TextLabel")
  29. Title.Size = UDim2.new(1, 0, 0, 30)
  30. Title.BackgroundTransparency = 1
  31. Title.Text = "🎵 Music Player v3"
  32. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  33. Title.TextScaled = true
  34. Title.Parent = Frame
  35.  
  36. --
  37. local SoundBox = Instance.new("TextBox")
  38. SoundBox.Size = UDim2.new(0, 250, 0, 35)
  39. SoundBox.Position = UDim2.new(0.5, -125, 0, 40)
  40. SoundBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  41. SoundBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  42. SoundBox.PlaceholderText = "Enter Sound ID..."
  43. SoundBox.Parent = Frame
  44.  
  45. --
  46. local PitchBox = Instance.new("TextBox")
  47. PitchBox.Size = UDim2.new(0, 250, 0, 35)
  48. PitchBox.Position = UDim2.new(0.5, -125, 0, 80)
  49. PitchBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  50. PitchBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  51. PitchBox.PlaceholderText = "Enter Pitch (1 = Normal)..."
  52. PitchBox.Parent = Frame
  53.  
  54. --
  55. local UIGradient = Instance.new("UIGradient")
  56. UIGradient.Color = ColorSequence.new{
  57. ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 120, 120)),
  58. ColorSequenceKeypoint.new(1, Color3.fromRGB(120, 120, 255))
  59. }
  60. UIGradient.Parent = Frame
  61.  
  62. --
  63. local function CreateButton(name, text, pos, color)
  64. local Button = Instance.new("TextButton")
  65. Button.Size = UDim2.new(0, 110, 0, 40)
  66. Button.Position = pos
  67. Button.BackgroundColor3 = color
  68. Button.TextColor3 = Color3.fromRGB(255, 255, 255)
  69. Button.Text = text
  70. Button.Font = Enum.Font.SourceSansBold
  71. Button.TextScaled = true
  72. Button.Parent = Frame
  73.  
  74. local ButtonCorner = Instance.new("UICorner")
  75. ButtonCorner.CornerRadius = UDim.new(0, 8)
  76. ButtonCorner.Parent = Button
  77.  
  78. return Button
  79. end
  80.  
  81. --
  82. local PlayButton = CreateButton("PlayButton", "▶ Play", UDim2.new(0.5, -125, 0, 130), Color3.fromRGB(0, 200, 0))
  83. local StopButton = CreateButton("StopButton", "⏹ Stop", UDim2.new(0.5, 15, 0, 130), Color3.fromRGB(200, 0, 0))
  84. local PitchButton = CreateButton("PitchButton", "⚡ Change Pitch", UDim2.new(0.5, -55, 0, 180), Color3.fromRGB(0, 120, 255))
  85.  
  86. --
  87. local Sound = Instance.new("Sound")
  88. Sound.Parent = game:GetService("Workspace")
  89. Sound.Looped = true
  90. Sound.Volume = 3 -- Adjust volume if needed
  91.  
  92. --
  93. PlayButton.MouseButton1Click:Connect(function()
  94. local soundID = SoundBox.Text
  95. local pitch = tonumber(PitchBox.Text) or 1
  96.  
  97. if soundID ~= "" then
  98. Sound.SoundId = "rbxassetid://" .. soundID
  99. Sound.PlaybackSpeed = pitch
  100. Sound:Play()
  101. end
  102. end)
  103.  
  104. --
  105. StopButton.MouseButton1Click:Connect(function()
  106. Sound:Stop()
  107. end)
  108.  
  109. --
  110. PitchButton.MouseButton1Click:Connect(function()
  111. local pitch = tonumber(PitchBox.Text) or 1
  112. Sound.PlaybackSpeed = pitch
  113. end)
  114.  
Advertisement
Add Comment
Please, Sign In to add comment