#💬 malito4031ʹs Feedback
1 messages · Page 1 of 1 (latest)
sounds off. But otherwise really cool
that hard to make the sound synced up
What are you using for a timer. Heartbeat, renderstepped, or a while loop?
While loop
Look up heartbeat and os.clock. Using those is a much more reliable method of timing.
okay thx
yea but os clock is saying how many time the cpu render the script
that not good for a loop ?
Nono. I mean use it IN the loop.
local RunService = game:GetService("RunService")
local lastLooped = os.clock()
local LOOP_TIME = 10 -- the time that every track takes to do one loop
RunService.Heartbeat:Connect(function()
local currentTime = os.clock() - lastLooped
if currentTime < LOOP_TIME then
return
end
-- the timer has ended, play waiting songs.
lastLooped = os.clock()
end)