Kalcetin Studio
Member
Hello 
Try using this tutorial to customize a different sound for each item. http://www.chronocrash.com/forum/index.php?topic=3115.0
It works, but all the samples sound at the same time with all the Items
This is the script, can someone help me see if I did something wrong? I'm still a beginner at scripts.
Thanks =)
Try using this tutorial to customize a different sound for each item. http://www.chronocrash.com/forum/index.php?topic=3115.0
It works, but all the samples sound at the same time with all the Items
This is the script, can someone help me see if I did something wrong? I'm still a beginner at scripts.
Code:
void main(){
// Custom sounds for picking itens
// Douglas Baldan / O Ilusionista - 11/12/2016
// Thanks Damon Caskey for the support
void self = getlocalvar("self"); //get the self var
void hit = getlocalvar("damagetaker"); // get target entity
char Name = getentityproperty(self,"name"); // get target's name
void power = getentityproperty(hit,"mp"); // get target's current mp
int sample; // Sample to play.
int animation; // Animation to apply.
int SFX1 = loadsample("data/sounds/SFXNck/SFXkaiRisa.wav"); // load samples
int SFX2 = loadsample("data/sounds/SFXNck/Select1Up1.wav"); // load samples
int SFX3 = loadsample("data/sounds/SFXNck/Select1Up3.wav"); // load samples
int SFX4 = loadsample("data/sounds/SFXNck/Select1Up3.wav"); // load samples
int SFX5 = loadsample("data/sounds/SFXNck/Select1Up4.wav"); // load samples
switch(Name) { // check the item name
case "ItKaty" : // power up, Item del arma
sample = SFX1;
break;
case "ItMone" : // power up, Item del arma
sample = SFX2;
break;
case "ItVerte" : // power up, Item del arma
sample = SFX3;
break;
case "ItRodo" : // power up, Item del arma
sample = SFX4;
break;
case "ItNath" : // power up, Item del arma
sample = SFX5;
break;
default : // in case of none of above
break;
}
//spawnAni("tomalo",0,30,0,"ANI_IDLE",NULL(),NULL(),NULL());
playsample(SFX1, 0, 120, 120, 100, 0);
playsample(SFX2, 0, 120, 120, 100, 0);
playsample(SFX3, 0, 120, 120, 100, 0);
playsample(SFX4, 0, 120, 120, 100, 0);
playsample(SFX5, 0, 120, 120, 100, 0);
}
Thanks =)