Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.12 KB | None | 0 0
  1. --[[ Flex
  2.     █▀▀ █▀▀█ █▀▀▄ █▀▀█ █▀█ █▀▀█ ▄█  █▀▀
  3.     █▀▀ █▄▄▀ █  █ █  █  ▄▀ █▄▀█  █  ▀▀▄
  4.     ▀▀▀ ▀ ▀▀ ▀  ▀ ▀▀▀▀ █▄▄ █▄▄█ ▄█▄ ▄▄▀
  5. --]]
  6. local notes = {
  7.     --[[Clock Time -->]] ["15"] = "rbxassetid://1838601237"; --[[<-- Music Id]]--
  8.     ["16"] = "rbxassetid://1837871067" 
  9. }
  10. local L = game:GetService("Lighting")
  11.  
  12. function getCurrentHour()
  13.     local hour = tonumber(string.split(L.TimeOfDay, ":")[1])
  14.     return hour
  15. end
  16.  
  17. while wait() do
  18.     local currentTime = getCurrentHour()
  19.     if currentTime then
  20.         local music, timePos
  21.         for t, id in pairs(notes) do
  22.             if tonumber(t) == currentTime then
  23.                 music = Instance.new("Sound")
  24.                 music.Parent = workspace
  25.                 music.Name = "Music"
  26.                 music.SoundId = id
  27.                 music.Looped = false
  28.                 music:Play()
  29.                 timePos = tonumber(t)
  30.                 break
  31.             end
  32.         end
  33.         if music then
  34.             repeat
  35.                 currentTime = getCurrentHour()
  36.                 wait()
  37.             until currentTime ~= timePos
  38.             print(currentTime, timePos)
  39.             print("Out Of Cycle")
  40.             music:Destroy()
  41.         end
  42.     end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement