plunkettscott / interact-sound

A resource providing the ability to play sounds using the FiveM NUI environment.
https://plunkettscott.gitbooks.io/scott-s-script-documentation/content/scripts/interactsound.html
MIT License
63 stars 129 forks source link

Play multip sounds #19

Closed RadhwaneDZ closed 3 years ago

RadhwaneDZ commented 3 years ago

Feature request Its possible to play multip sounds once sound1 played wait little bit than play anouther sound ?

Here is my client.lua

--Zombie sounds
Citizen.CreateThread(function()
    while true do
        Citizen.Wait(5000)
        for i, entity in pairs(entitys) do
            playerX, playerY, playerZ = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
            pedX, pedY, pedZ = table.unpack(GetEntityCoords(entity, true))
            if IsPedDeadOrDying(entity, 1) == 1 then
                --none :v
            else
                if(Vdist(playerX, playerY, playerZ, pedX, pedY, pedZ) <= 10.0 ) then

                    TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 5.0, "groan3", 1.0)

                end
            end
        end
    end
end)
plunkettscott commented 3 years ago

You should be able to do this with a Wait() between PlayWithinDistance events.

plunkettscott commented 3 years ago

Going to close this since I haven't heard from you in a few months. Feel free to reopen if you need any further guidance.