Hi I would like to know why this script for playing sounds has latency:
--Script by Mr_RainBowsYT
local PitchValue = 1
local MainVolume = 1
local nextSongPlayTime = 2 -- Seconds until the next song will be played, if you want you can leave it at 2.(2 is the default)
-- Ne pas modifier le script --
local songs = {1585166473,4998677536,1606919876}
local sound = script.Parent
sound.Pitch = PitchValue
sound.Volume = MainVolume
while true do
sound.SoundId = "rbxassetid://"..songs[math.random(1,#songs)]
sound:Play()
wait(sound.TimeLength)
sound:Stop()
wait(nextSongPlayTime)
end
-
When I hit run/play on roblox studio or roblox player, it has a ~8 second latency and sometimes a part of the sound plays for 2 seconds and gets stopped by the next sound instead of playing the first sound at start.
-
I tried looking in the dev foru but nothing seems to talk about this
Path:
Internet performance: