Xogy / xsound

Improved audio library for FiveM
MIT License
115 stars 82 forks source link

Export onPlayEnd is not working #54

Closed Red-Killer closed 10 months ago

Red-Killer commented 11 months ago

Describe the bug The export onPlayEnd is not working im getting this error below:

802_GTAProce]             MainThrd/ ^1SCRIPT ERROR: @xsound/client/exports/events.lua:8: attempt to index a nil value (field '?')^7
[   9195937] [b2802_GTAProce]             MainThrd/ ^3> ref^7 (^5@xsound/client/exports/events.lua^7:8)
[   9195937] [b2802_GTAProce]             MainThrd/ ^3> fn^7 (^5@lb-musicapp/client.lua^7:112)
[   9195937] [b2802_GTAProce]             MainThrd/ ^1SCRIPT ERROR: @lb-musicapp/client.lua:112: 
[   9195937] [b2802_GTAProce]             MainThrd/ ^5 An error occurred while calling export `onPlayEnd` in resource `xsound`:

image

My Code:

xSound:onPlayEnd(musicId, function()
    print("end")
end)

image

Xogy commented 10 months ago

This is expected if the sound ID doesnt exists you cannot use these events they have to be called after PlayUrl / PlayUrlPos

image image

Red-Killer commented 10 months ago

Oh okay