(05-28-2011, 11:13 AM)Tanshaydar Wrote: [SetEntityActive("servant_grunt_1", true);]
'[' & ']' needless. Omit all of them.
My script now looks like this but it still doesnt work:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Func01", true, 1);
}
void Func01(string &in asParent, string &in asChild, int alState)
{
int x = RandInt(1, 3);
if (x == 1)
{
SetEntityActive("servant_grunt_1", true);
return;
}
if (x == 2)
{
SetEntityActive("servant_grunt_1", true);
SetEntityActive("servant_grunt_2", true);
return;
}
if (x == 3)
{
SetEntityActive("servant_grunt_1", true);
SetEntityActive("servant_grunt_2", true);
SetEntityActive("servant_grunt_3", true);
return;
}
}
////////////////////////////
// Run when entering map
void OnEnter()
{
PlayMusic("ambience_voice.ogg", true, 0.7f, 1, 0, false);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}