Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Made by Memo1332/Poin Test for.. some reason
- -- Idk, I guess I got bored lol
- -- Objects
- local Musics = Instance.new("ScreenGui")
- local OuterFrame = Instance.new("Frame")
- local Pause = Instance.new("TextButton")
- local Play = Instance.new("TextButton")
- local Stop = Instance.new("TextButton")
- local Replay = Instance.new("TextButton")
- local CurrentTime = Instance.new("TextLabel")
- local EndTime = Instance.new("TextLabel")
- local Ent = Instance.new("TextBox")
- local Music = Instance.new("Sound")
- local BarFolder = Instance.new("Folder")
- local Bar = Instance.new("Frame")
- local Slide = Instance.new("Frame")
- local Barhit = Instance.new("TextButton")
- -- Properties
- Musics.Name = "Music"
- Musics.Parent = game.Players.LocalPlayer.PlayerGui
- Musics.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- OuterFrame.Name = "OuterFrame"
- OuterFrame.Parent = Musics
- OuterFrame.AnchorPoint = Vector2.new(1, 1)
- OuterFrame.BackgroundColor3 = Color3.new(0, 0, 0)
- OuterFrame.BackgroundTransparency = 0.5
- OuterFrame.Position = UDim2.new(1, -10, 1, -10)
- OuterFrame.Size = UDim2.new(0.300000012, 0, 0.100000001, 0)
- OuterFrame.SizeConstraint = Enum.SizeConstraint.RelativeXX
- Music.Parent = OuterFrame
- Music.Volume = 2
- Music.Looped = true
- BarFolder.Name = "Bar"
- BarFolder.Parent = OuterFrame
- Bar.Name = "Bar"
- Bar.Parent = BarFolder
- Bar.AnchorPoint = Vector2.new(0.5, 0)
- Bar.BackgroundColor3 = Color3.new(1, 1, 1)
- Bar.Position = UDim2.new(0.5, 0, 0.460000008, 0)
- Bar.Size = UDim2.new(0.899999976, 0, 0.0299999993, 0)
- Slide.Name = "Slide"
- Slide.Parent = Bar
- Slide.AnchorPoint = Vector2.new(0.5, 0.5)
- Slide.BackgroundColor3 = Color3.new(0.968628, 0, 1)
- Slide.BorderSizePixel = 0
- Slide.Position = UDim2.new(0, 0, 0.5, 0)
- Slide.Size = UDim2.new(1.5, 0, 6, 0)
- Slide.SizeConstraint = Enum.SizeConstraint.RelativeYY
- Barhit.Name = "Barhit"
- Barhit.Parent = BarFolder
- Barhit.AnchorPoint = Vector2.new(0.5, 0.5)
- Barhit.BackgroundColor3 = Color3.new(1, 1, 1)
- Barhit.BackgroundTransparency = 1
- Barhit.Position = UDim2.new(0.5, 0, 0.479999989, 0)
- Barhit.Size = UDim2.new(0.949999988, 0, 0.200000003, 0)
- Barhit.ZIndex = 2
- Barhit.Font = Enum.Font.SourceSans
- Barhit.Text = ""
- Barhit.TextColor3 = Color3.new(0, 0, 0)
- Barhit.TextSize = 14
- Pause.Name = "Pause"
- Pause.Parent = OuterFrame
- Pause.AnchorPoint = Vector2.new(0.5, 0)
- Pause.BackgroundColor3 = Color3.new(1, 0, 0.952941)
- Pause.BackgroundTransparency = 0.69999998807907
- Pause.Position = UDim2.new(0.5, 0, 0.63499999, 0)
- Pause.Size = UDim2.new(0.102763534, 0, 0.307033986, 0)
- Pause.Visible = false
- Pause.Font = Enum.Font.SourceSans
- Pause.Text = " ▌▌"
- Pause.TextColor3 = Color3.new(1, 1, 1)
- Pause.TextSize = 14
- Play.Name = "Play"
- Play.Parent = OuterFrame
- Play.AnchorPoint = Vector2.new(0.5, 0)
- Play.BackgroundColor3 = Color3.new(1, 0, 0.952941)
- Play.BackgroundTransparency = 0.69999998807907
- Play.Position = UDim2.new(0.5, 0, 0.63499999, 0)
- Play.Size = UDim2.new(0.102763534, 0, 0.307033986, 0)
- Play.Font = Enum.Font.SourceSans
- Play.Text = "▷"
- Play.TextColor3 = Color3.new(1, 1, 1)
- Play.TextScaled = true
- Play.TextSize = 14
- Play.TextWrapped = true
- Stop.Name = "Stop"
- Stop.Parent = OuterFrame
- Stop.AnchorPoint = Vector2.new(0.5, 0)
- Stop.BackgroundColor3 = Color3.new(1, 0, 0.952941)
- Stop.BackgroundTransparency = 0.69999998807907
- Stop.Position = UDim2.new(0.643000007, 0, 0.63499999, 0)
- Stop.Size = UDim2.new(0.102763534, 0, 0.307033986, 0)
- Stop.Font = Enum.Font.SourceSans
- Stop.Text = "□"
- Stop.TextColor3 = Color3.new(1, 1, 1)
- Stop.TextScaled = true
- Stop.TextSize = 14
- Stop.TextWrapped = true
- Stop.TextYAlignment = Enum.TextYAlignment.Top
- Replay.Name = "Replay"
- Replay.Parent = OuterFrame
- Replay.AnchorPoint = Vector2.new(0.5, 0)
- Replay.BackgroundColor3 = Color3.new(1, 0, 0.952941)
- Replay.BackgroundTransparency = 0.69999998807907
- Replay.Position = UDim2.new(0.356999993, 0, 0.63499999, 0)
- Replay.Size = UDim2.new(0.102763534, 0, 0.307033986, 0)
- Replay.Font = Enum.Font.SourceSans
- Replay.Text = "◁◁"
- Replay.TextColor3 = Color3.new(1, 1, 1)
- Replay.TextScaled = true
- Replay.TextSize = 14
- Replay.TextWrapped = true
- CurrentTime.Name = "CurrentTime"
- CurrentTime.Parent = OuterFrame
- CurrentTime.AnchorPoint = Vector2.new(0.5, 0)
- CurrentTime.BackgroundColor3 = Color3.new(0.968628, 0, 1)
- CurrentTime.BackgroundTransparency = 1
- CurrentTime.Position = UDim2.new(0.159999996, 0, 0.63499999, 0)
- CurrentTime.Size = UDim2.new(0.230000004, 0, 0.307000011, 0)
- CurrentTime.Font = Enum.Font.SourceSans
- CurrentTime.Text = "0:00"
- CurrentTime.TextColor3 = Color3.new(1, 1, 1)
- CurrentTime.TextScaled = true
- CurrentTime.TextSize = 14
- CurrentTime.TextWrapped = true
- EndTime.Name = "EndTime"
- EndTime.Parent = OuterFrame
- EndTime.AnchorPoint = Vector2.new(0.5, 0)
- EndTime.BackgroundColor3 = Color3.new(0.968628, 0, 1)
- EndTime.BackgroundTransparency = 1
- EndTime.Position = UDim2.new(0.839999974, 0, 0.63499999, 0)
- EndTime.Size = UDim2.new(0.230000004, 0, 0.307000011, 0)
- EndTime.Font = Enum.Font.SourceSans
- EndTime.Text = "0:00"
- EndTime.TextColor3 = Color3.new(1, 1, 1)
- EndTime.TextScaled = true
- EndTime.TextSize = 14
- EndTime.TextWrapped = true
- Ent.Name = "Ent"
- Ent.Parent = OuterFrame
- Ent.AnchorPoint = Vector2.new(0.5, 0)
- Ent.BackgroundColor3 = Color3.new(1, 1, 1)
- Ent.BackgroundTransparency = 1
- Ent.Position = UDim2.new(0.5, 0, -0.0149999997, 10)
- Ent.Size = UDim2.new(0.839999974, 0, 0.314999998, 0)
- Ent.Font = Enum.Font.SourceSans
- Ent.PlaceholderText = ""
- Ent.Text = ""
- Ent.TextColor3 = Color3.new(1, 1, 1)
- Ent.TextScaled = true
- Ent.TextSize = 14
- Ent.TextWrapped = true
- -- Scripts
- rbx = game:GetService("MarketplaceService")
- user = game:GetService("UserInputService")
- local mouse = game.Players.LocalPlayer:GetMouse()
- local drag = false
- local startpos = nil
- local start = nil
- local play = false
- Ent.FocusLost:Connect(function(ent)
- if ent == true then
- local txt = Ent
- local sound = Music
- if txt.Text:sub(1,6):lower() == "pitch/" then
- sound.Pitch = tonumber(txt.Text:sub(7))
- txt.Text = rbx:GetProductInfo(tonumber(sound.SoundId:sub(14))).Name
- elseif txt.Text:sub(1,7):lower() == "volume/" then
- sound.Volume = tonumber(txt.Text:sub(8))
- txt.Text = rbx:GetProductInfo(tonumber(sound.SoundId:sub(14))).Name
- else
- local product = rbx:GetProductInfo(tonumber(txt.Text))
- if product.Name ~= nil then
- sound.SoundId = "rbxassetid://"..txt.Text
- sound.TimePosition = 0
- sound.Pitch = 1
- sound:Play()
- Pause.Visible = true
- Play.Visible = false
- txt.Text = product.Name
- end
- end
- else
- local sound = Music
- if sound.SoundId ~= "" then
- local txt = Ent
- txt.Text = rbx:GetProductInfo(tonumber(sound.SoundId:sub(14))).Name
- end
- end
- end)
- Play.MouseButton1Click:Connect(function()
- if drag == false then
- local sound = Music
- sound:Resume()
- Pause.Visible = true
- Play.Visible = false
- end
- end)
- Pause.MouseButton1Click:Connect(function()
- local sound = Music
- sound:Pause()
- Pause.Visible = false
- Play.Visible = true
- end)
- Stop.MouseButton1Click:Connect(function()
- if drag == false then
- local sound = Music
- sound:Stop()
- sound.TimePosition = 0
- Pause.Visible = false
- Play.Visible = true
- end
- end)
- Replay.MouseButton1Click:Connect(function()
- if drag == false then
- local sound = Music
- sound.TimePosition = 0
- sound:Play()
- Pause.Visible = true
- Play.Visible = false
- end
- end)
- Barhit.MouseButton1Down:Connect(function(x,y)
- local sound = Music
- if sound.Playing == true then
- play = true
- else
- play = false
- end
- sound:Pause()
- Pause.Visible = false
- Play.Visible = true
- -----------
- startpos = x
- drag = true
- start = sound.TimePosition
- end)
- Barhit.MouseButton1Up:Connect(function()
- drag = false
- start = nil
- startpos = nil
- if play == true then
- local sound = Music
- sound:Resume()
- Pause.Visible = true
- Play.Visible = false
- end
- end)
- function dec(number)
- local h = tostring(number)
- local thenumber = 0
- for i=1,100 do
- if string.sub(h,i,i) == "." then
- thenumber = i
- break
- end
- end
- number = string.sub(h,1,thenumber - 1)
- number = tonumber(number)
- return (number)
- end
- function clock(seconds)
- -- Military Clock Converter (but better)
- local minutes = 0
- while seconds >= 60 do
- minutes = minutes + 1
- seconds = seconds - 60
- end
- --Line of strings
- seconds = dec(seconds)
- if seconds < 10 then
- seconds = "0"..tostring(seconds)
- end
- return (minutes..":"..seconds)
- end
- coroutine.resume(coroutine.create(function()
- --[[while wait() do
- local sound = Music
- OuterFrame.CurrentTime.Text = clock(sound.TimePosition)
- OuterFrame.EndTime.Text = clock(sound.TimeLength)
- end]]
- end))
- game:GetService("RunService").RenderStepped:Connect(function()
- if drag == true then
- local loc = user:GetMouseLocation()
- local sum = loc.X-startpos
- local sound = Music
- if (start + sum/3) >= 0 and (start + sum/3) <= sound.TimeLength then
- sound.TimePosition = start + sum/3
- end
- end
- local sound = Music
- OuterFrame.CurrentTime.Text = clock(sound.TimePosition)
- OuterFrame.EndTime.Text = clock(sound.TimeLength)
- local sound = Music
- local bar = Bar.Slide
- if sound.TimePosition ~= 0 and sound.TimeLength ~= 0 then
- bar.Position = UDim2.new(sound.TimePosition/sound.TimeLength,0,0.5,0)
- else
- bar.Position = UDim2.new(0,0,0.5,0)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement