The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Whats wrong with my script?
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#1
Whats wrong with my script?

Hi, I was trying to script random events today but it doesnt work, can anyone see whats wrong with my script'?

////////////////////////////
// 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()
{

}

05-28-2011, 10:48 AM
Find


Messages In This Thread
Whats wrong with my script? - by Henriksen - 05-28-2011, 10:48 AM
RE: Whats wrong with my script? - by Tanshaydar - 05-28-2011, 11:13 AM
RE: Whats wrong with my script? - by Henriksen - 05-28-2011, 11:14 AM
RE: Whats wrong with my script? - by Tanshaydar - 05-28-2011, 11:19 AM



Users browsing this thread: 1 Guest(s)