Hello there!
I'm working on my first custom story at the moment. I'm very new to scripting, but I think I'm going pretty well.
Any way, I have a lever in my map, and when I pull it down I'm trying to get this carpet to disappear and a sound to play(The carpet is concealing a secret trapdoor). However, it's not working. The debug message that I set to show works, but the rest doesn't. Here's my script:
void Leverpulled(string &in asEntity, int alState)//"Leverpulled" is the ConnectionStateChangeCallback that I set in the map editor.
{
if(alState == -1){
SetEntityActive("Hiddencarpet", false);
PlaySoundAtEntity("Carpetnoise", "break_wood_metal.snt", "Hiddencarpet", 1.0f, false);
AddDebugMessage("Lever Pulled", true);
}
}
Can anyone see what the problem would be? There are no errors in the script, apparently.