#audio desynchronization

10 messages · Page 1 of 1 (latest)

rare furnace
#

my script has the int4ention that every time a specific player "X" joins it starts an event, but the problem is that the audio is out of phase with the GUI, that is to say that the GUI and its animation starts first and at the last seconds after comes the audio and I don't know how to solve it.
the script:
local EntitieUser = require(script.ModuleScript)
local guiToClone = script.ENTETIE

local function CloneGuiToPlayerGui(player, guiToClone)
local playerGui = player:FindFirstChild("PlayerGui")
if playerGui then
local guiClone = guiToClone:Clone()
guiClone.Parent = playerGui
end
wait(5.1)
if guiToClone.Parent == playerGui then
guiToClone:Destroy()
end
end
local jugadoresEspecificos = {
["AngeLo_Fidem"] = true,
["Sename_Recordss"] = true,
}

game.Players.PlayerAdded:Connect(function(player)
local userId = tostring(player.UserId)
local playerData = EntitieUser.IDs[player.Name]

if jugadoresEspecificos[player.Name] then
    for _, otherPlayer in ipairs(game.Players:GetPlayers()) do
        EntitieUser.playSound(otherPlayer)
        CloneGuiToPlayerGui(otherPlayer, guiToClone)
    end
end

end)

and the fuction from Modulescript

function EntitieUser.playSound(player)
local playerData = EntitieUser.IDs[player.Name]

if playerData then
    local sound = Instance.new("Sound")
    sound.SoundId = playerData.SoundId
    sound.Parent = game.Workspace 
    sound.Volume = 1
    sound:Play()
    task.wait(2)
    sound.Ended:Connect(function()
        
        sound:Destroy()
    end)
end

end
https://streamable.com/lq59zs

Watch "Roblox VR 2024.06.26 - 14.26.31.04.DVR" on Streamable.

▶ Play video
rapid mica
#

I mean its kind of a nice effect

#

😛

#

Try checking to see if playeradded is working ik sometimes it doesnt work if at the end of a script

#

if not use childadded

rare furnace
#

like on the Roblox Studio work 100% for me, but when i teste it on the publish version

#

happend what you see on the video

#

and idk what else to do ice_cube_sob

rapid mica