-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathclient.lua
18 lines (15 loc) · 845 Bytes
/
client.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-- RequestScriptAudioBank will be used to load the .awc container that holds all the sounds. Follow the folder structure starting from the resource audiodirectory/custom_sounds
-- The audioRef will be `special_soundset` because we called our soundset that
-- You can use any sound that you put inside your soundset.
RegisterCommand('testsound', function (source, args, raw)
while not RequestScriptAudioBank('audiodirectory/custom_sounds', false) do Wait(0) end
print('Audio bank loaded')
local soundId = GetSoundId()
PlaySoundFrontend(soundId, 'wow', 'special_soundset', true)
ReleaseSoundId(soundId)
Wait(2000)
local soundId2 = GetSoundId()
PlaySoundFrontend(soundId2, 'error', 'special_soundset', true)
ReleaseSoundId(soundId2)
ReleaseNamedScriptAudioBank('audiodirectory/custom_sounds')
end, false)