void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_brute_1" , true);
PlaySoundAtEntity("", "explosion_rock_large.snt", "Player", 0.5f, false);
{ <--- legal, but not needed
AddEntityCollideCallback("Player" , "ScriptArea_2" , "MonsterFunc1" , true , 1);
} <--- legal, but not needed
/*
These lines below are illegal, functions cannot be defined inside other functions. This means previous function is still being defined, because there's no closing bracket before this. Added to that, the following function has the same name.
*/
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("barrel01_20" , true);
SetEntityActive("barrel01_21" , true);
SetEntityActive("barrel01_22" , true);
SetEntityActive("barrel01_28" , true);
SetEntityActive("barrel01_29" , true);
SetEntityActive("barrel01_23" , true);
SetEntityActive("barrel01_24" , true);
SetEntityActive("barrel01_25" , true);
SetEntityActive("barrel01_27" , true);
SetEntityActive("barrel01_26" , true);
SetEntityActive("barrel01_10" , true);
PlaySoundAtEntity("", "explosion_rock_large.snt", "Player", 0.5f, false);
}
} <-- This is closing the first MonsterFunc1
I suggest you check the basics of the scripting language, as in how to build correct structures and stuff like that before doing any real work. Trust me, it will save you lots of headaches