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
The "IF" with HasItem
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#3
RE: The "IF" with HasItem

(04-09-2012, 12:52 AM)Apjjm Wrote: You will want your code to look at follows:
void Scary1(string &in asParent, string &in asChild, int alState)
{
//Things that should happen if regardless of if you have the key or not
if(HasItem("The_gone_key"))
  {
    //Scary Stuff happens here for when you have the key
  }
}

assuming you want to make aggrippa headless appear when the key has gone:
void Scary1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("The_gone_key"))
  {
    SetEntityActive("agrippa_headless_1", true);
  }
}
dosnt work :S the Script activate when i dont have the key :/





void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_4", "Scary1", true, 1);

}
void Scary1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("The_gone_key"))
{
SetEntityActive("agrippa_headless_1", true);
PlaySoundAtEntity("", "alois_amb_idle.snt", "Player", 0, false);
}
}




http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
04-09-2012, 03:20 AM
Website Find


Messages In This Thread
The "IF" with HasItem - by jessehmusic - 04-09-2012, 12:46 AM
RE: The "IF" with HasItem - by Apjjm - 04-09-2012, 12:52 AM
RE: The "IF" with HasItem - by jessehmusic - 04-09-2012, 03:20 AM
RE: The "IF" with HasItem - by Apjjm - 04-09-2012, 03:40 AM
RE: The "IF" with HasItem - by jessehmusic - 04-09-2012, 01:02 PM
RE: The "IF" with HasItem - by Quotentote - 04-09-2012, 06:21 AM
RE: The "IF" with HasItem - by jessehmusic - 04-09-2012, 01:12 PM
RE: The "IF" with HasItem - by Damascus - 04-09-2012, 09:30 AM
RE: The "IF" with HasItem - by SilentStriker - 04-09-2012, 09:57 AM
RE: The "IF" with HasItem - by jessehmusic - 04-09-2012, 08:39 PM
RE: The "IF" with HasItem - by Datguy5 - 04-09-2012, 10:49 AM
RE: The "IF" with HasItem - by SilentStriker - 04-09-2012, 01:11 PM
RE: The "IF" with HasItem - by Datguy5 - 04-09-2012, 06:17 PM
RE: The "IF" with HasItem - by Obliviator27 - 04-09-2012, 09:16 PM
RE: The "IF" with HasItem - by jessehmusic - 04-09-2012, 09:34 PM
RE: The "IF" with HasItem - by Obliviator27 - 04-09-2012, 10:22 PM
RE: The "IF" with HasItem - by jessehmusic - 04-10-2012, 11:32 AM
RE: The "IF" with HasItem - by SilentStriker - 04-10-2012, 12:40 PM
RE: The "IF" with HasItem - by jessehmusic - 04-10-2012, 12:45 PM
RE: The "IF" with HasItem - by Apjjm - 04-10-2012, 01:12 PM
RE: The "IF" with HasItem - by jessehmusic - 04-10-2012, 03:40 PM



Users browsing this thread: 1 Guest(s)