11-03-2012, 03:08 PM
I have a problem with this script piece:
The slimes won't disapear when i use my lantern and every time when i turn it on or off it makes that "puzzle_acid" sound.
I want the sound only heard once and the slimes disapear when i turn my lantern ON in the "LanternArea".
EDIT: and there appeared to be an another problem: When i turn the lantern off or on several times, the
game crahes.(in the "LanternArea")
Sorry for my bad english
Code:
void CollideLanternArea(string &in asParent,string &in asChild,int alState)
{
if(alState == 1){
if(HasItem("lantern_1"))
SetLanternLitCallback("SlimeOff");
}
}
void SlimeOff(bool abLit)
{
for(int i; i<8; i++)SetPropActiveAndFade("slime_"+i,false,1.5);
PlayGuiSound("puzzle_acid",3);
FadeLightTo("PointLight_18", 0,0, 0, 0, 0, 3);
}
The slimes won't disapear when i use my lantern and every time when i turn it on or off it makes that "puzzle_acid" sound.
I want the sound only heard once and the slimes disapear when i turn my lantern ON in the "LanternArea".
EDIT: and there appeared to be an another problem: When i turn the lantern off or on several times, the
game crahes.(in the "LanternArea")
Sorry for my bad english