Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is the sound delayed? (script plays it)

Asked by
gumpy_e 22
4 years ago

so i have this gif script. so what you do to use it it is like this for example: i want this video on here (has to be shorter then 50 or it wont work) i download it on a site for both mp4 and mp3 convert the mp4 to sprite sheet and upload the mp3. then you upload the sprite sheet as a decal

for some reason the sound is delayed by half a second. this is my code also

coroutine.resume(coroutine.create(function()

local Frames = 836
local currentFrame= 1

local rows = 38
local columns = 22
local currentRow,CurrentColumn = 0,0

local linear = false

local fps = 30 -- Max 30
local full60fps = false
local size = script.Parent.Parent.Size
script.Parent.StudsPerTileU = columns*size.X
script.Parent.StudsPerTileV = rows*size.Y
while true do
    if not full60fps then wait(1/fps) else game:GetService("RunService").Stepped:Wait(0.05) end
    if linear then
        script.Parent.OffsetStudsU = script.Parent.OffsetStudsU + size.X
        if script.Parent.OffsetStudsU > script.Parent.StudsPerTileU then
            script.Parent.OffsetStudsU = 0
        end
    else
        CurrentColumn = CurrentColumn + 1
            if CurrentColumn > columns then
            CurrentColumn = 1
            currentRow = currentRow + 1
        end
        if currentFrame > Frames then
                script.Parent.Parent.Sound:Play()
            currentRow,CurrentColumn,currentFrame = 1,1,1
        end
        script.Parent.OffsetStudsU = size.X*(CurrentColumn-1)
        script.Parent.OffsetStudsV = size.Y*(currentRow-1)
        currentFrame = currentFrame+1
    end
end 
end))

if anyone could help with this i would appreciate it

0
Try checking if the sound is loaded, if that doesnt work then check whether its playing before starting the animation. Benbebop 1049 — 4y

Answer this question