Page 1 of 1

Change sound effect via .lua/script? [Solved]

Posted: Thu Dec 21, 2017 5:05 pm
by CdtFox
Hey guys,

Quick question, would it possible to change an explosion sound-effect via lua coding? I tried using multiple methods, no one worked. Everything is under ScriptPostLoad().

I'm mainly interested in switching detonators explosion sound, here are my different tries.

The detonator's _exp is named "gun_weap_inf_haywiredetonator_exp" and the sound effect I want to use is "com_weap_inf_haywire_exp". The sound is proprely loaded in a custom lvl. It works fine when I directly edit the .odf.

Code: Select all

SetSoundEffect("gun_weap_inf_haywiredetonator_exp", "SoundProperty", "com_weap_inf_haywire_exp")

SetProprety("gun_weap_inf_haywiredetonator_exp", "SoundProperty", "com_weap_inf_haywire_exp")

SetClassProprety("gun_weap_inf_haywiredetonator_exp", "SoundProperty", "com_weap_inf_haywire_exp")
Any idea? :D

Re: Change sound effect via .lua/script?

Posted: Thu Dec 21, 2017 6:15 pm
by AQT

Re: Change sound effect via .lua/script?

Posted: Fri Dec 22, 2017 2:13 am
by CdtFox
Thx :)