Advertisement
SebTDZ

a

Jul 28th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.33 KB | None | 0 0
  1. local MusicGui = Instance.new("ScreenGui",owner.PlayerGui)
  2. MusicGui.Name = "MusicGui"
  3.  
  4. function rgb(RED,GREEN,BLUE)
  5.     local Count = 1 / 255
  6.     --Red Count
  7.     local red = Count * RED
  8.     --Green Count
  9.     local green = Count * GREEN
  10.     --Blue Count
  11.     local blue = Count * BLUE
  12.     --Give Color3
  13.     local FColor = Color3.new(red,green,blue)
  14.     return FColor
  15. end
  16.  
  17. local BarHolder = Instance.new("Frame",MusicGui)
  18. BarHolder.BackgroundColor3 = rgb(185, 185, 185)
  19. BarHolder.BorderColor3 = rgb(135, 135, 135)
  20. BarHolder.BorderSizePixel = 10
  21. BarHolder.Name = "BarHolder"
  22. BarHolder.Position = UDim2.new(0.1,0,0,10)
  23. BarHolder.Size = UDim2.new(0.8,0,0.05,0)
  24.  
  25. local TimeBar = Instance.new("Frame",BarHolder)
  26. TimeBar.BackgroundColor3 = rgb(30, 230, 85)
  27. TimeBar.BorderColor3 = rgb(30, 230, 85)
  28. TimeBar.BorderSizePixel = 0
  29. TimeBar.Name = "BarHolder"
  30. TimeBar.Position = UDim2.new(0,0,0,0)
  31. TimeBar.Size = UDim2.new(0,0,1,0)
  32.  
  33. Music = Instance.new("Sound",workspace)
  34. Music.SoundId = "rbxassetid://2470261451"
  35. Music.Name = "Music"
  36. Music:Play()
  37. Music.Ended:Connect(function()
  38.     Music:Remove()
  39.     done = false
  40. end)
  41. done = true
  42. if not Music.IsLoaded then
  43.     Music.Loaded:wait()
  44. end
  45. local MS = 1 / Music.TimeLength
  46.  
  47. while done do
  48.     TimeBar.Size = UDim2.new(MS * Music.TimePosition,0,1,0)
  49.     wait(0.05)
  50. end
  51.  
  52. wait(2)
  53.  
  54. MusicGui:Remove()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement