Author Topic: Item_Energy_Shield Edit Help  (Read 557 times)

Ok so im trying to edit the sounds to be more like a halo shield and inside the code I cannot find a function where when the shield is low or completely depleted it makes a sound. It however has when the shield is full it'll play one. So I need help I am an extreme beginner in code, I just want someone to write a function (or explain how)that makes it play when the shield is low or at a certain percentage.

Here is the actual addon (ill take care of the sounds)
https://hostr.co/NzY10rEfSWfs

Thanks, -Fate- Aka Cheesypeesy babe

just replace the sounds "shield_capoff", "shield_deflect1", "shield_deflect2", and "shield_regen" with the sounds you want it to use.
they're pretty self-explanatory as to when they're played; capoff is played when the shield's fully recharged.

noedit: as for your play-sound-when-empty, add a new sound datablock by opening up support_eshields, and copy-pasting the code at the top and renaming it to the name you want it to be.

then locate this part of the code:

if(%obj.dmshield < 0){
    %obj.dmshield = 0;
}


and then add this after %obj.dmshield = 0;

serverPlay3D("name of sound datablock with or without quotes", %obj.getPosition());

noedit: as for your play-sound-when-empty, add a new sound datablock by opening up support_eshields, and copy-pasting the code at the top and renaming it to the name you want it to be.

then locate this part of the code:

if(%obj.dmshield < 0){
    %obj.dmshield = 0;
}


and then add this after %obj.dmshield = 0;

serverPlay3D("name of sound datablock with or without quotes", %obj.getPosition());
Thanks ill try this when i get home!

Thanks ill try this when i get home!
IT WORKS! Thankyou