Custom sounds
You can find sound installation instructions in the Sound Installation section.
To run custom sound, you need add to your resource fxmanifest.lua
file:
shared_scripts {
'@5s_lib/init.lua'
}
Client exports
Play local sound for client
fs.utils.PlayLocalSound(soundDict, soundName, ?soundBank)
--example
fs.utils.PlayLocalSound('5s_testsounds', 'test_sound')
Play sound from entity
fs.utils.PlaySoundFromEntity(soundDict, soundName, entity, networked, ?soundBank)
--example
fs.utils.PlaySoundFromEntity('5s_testsounds', 'test_sound', PlayerPedId(), false)
Play sound from coordinates
fs.utils.PlaySoundFromCoords(soundDict, soundName, coords, networked, ?soundBank)
--example
fs.utils.PlaySoundFromCoords('5s_testsounds', 'test_sound', vector3(0, 0, 0), false)
Server exports
Play local sound for client
fs.utils.PlayLocalSound(source, soundDict, soundName, ?soundBank)
--example
fs.utils.PlayLocalSound(source, '5s_testsounds', 'test_sound')
Play sound from entity
fs.utils.PlaySoundFromEntity(source, soundDict, soundName, entity, networked, ?soundBank)
--example
fs.utils.PlaySoundFromEntity(source, '5s_testsounds', 'test_sound', entity, false)
Play sound from coordinates
fs.utils.PlaySoundFromCoords(source, soundDict, soundName, coords, networked, ?soundBank)
--example
fs.utils.PlaySoundFromCoords(source, '5s_testsounds', 'test_sound', vector3(0, 0, 0), false)
Last updated