Jump to content

Playing a sound through LUA SCRIPT to the player currently using CTLD


Recommended Posts

Posted

Hi guys!

I would like to play a sound when loading and unloading crates when using CTLD. But I would like this audio to sound only to the player who is actually loading/unloading the cargo, and not to play the sound to all the players online.
 

Is that possible in the Lua Scrip? What code line could I use to do that?

I hope I made myself clear... English is not my first language and I'm not a programmer either... I'm just messing around with the CTLD script. 
Thanks for your support! 😃

Posted
On 2/11/2022 at 6:33 PM, Fabiano-VIKING said:

Hi guys!

I would like to play a sound when loading and unloading crates when using CTLD. But I would like this audio to sound only to the player who is actually loading/unloading the cargo, and not to play the sound to all the players online.
 

Is that possible in the Lua Scrip? What code line could I use to do that?

I hope I made myself clear... English is not my first language and I'm not a programmer either... I'm just messing around with the CTLD script. 
Thanks for your support! 😃

You need to use the trigger.action.outSoundForGroup(number groupId , string soundfile ) function (all units of the group will hear it - function does not exist for unit only).

But you need to get the groupID of the group that is loading/unloading crates, using datas from CTLD function (I can't tell exactly where/what to get from this script)

  • Like 1
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...