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
Script Help Area script. Help needed !
SpudroSpadre Offline
Junior Member

Posts: 14
Threads: 4
Joined: Dec 2011
Reputation: 0
#5
RE: Area script. Help needed !

(02-07-2012, 09:22 PM)SilentStriker Wrote:
(02-07-2012, 09:12 PM)SpudroSpadre Wrote: Hi all !

So let's say I have a script area ( ScriptArea_1 for example ) on map "FirstFloor"
and I want it to get activated when I pick up a key (Key_1) on map GuestRooms.

So the ScriptArea_1 and the Key_1 are both on different maps.

I have no slightest idea what I need to do to get it work.
All help would be appreciated.

Thx. Cool
Here's a script Smile

void OnStart()

{

    AddEntityCollideCallback("Player", "NAMEOFAREA", "HasKey_func",
false, 1); // This will activate every time the player enters the area.

}

void HasKey_func(string &in asParent, string &in asChild,  int alState)

{

    if(HasItem("NAMEOFKEY")) // Checks if the player has the key

    {

    

    SetEntityActive("NAMEOFAREA", false);// This gets rid of the area, so the script will only run once.

    }



// If the player doesn't have the key, nothing happens.

}
Thx so much. Im gonna test it in a while. Wink



TENSIONAL GAMES

- Currently working on a Amnesia custom story
02-07-2012, 09:41 PM
Find


Messages In This Thread
Area script. Help needed ! - by SpudroSpadre - 02-07-2012, 09:12 PM
RE: Area script. Help needed ! - by SilentStriker - 02-07-2012, 09:22 PM
RE: Area script. Help needed ! - by SpudroSpadre - 02-07-2012, 09:41 PM
RE: Area script. Help needed ! - by Khyrpa - 02-07-2012, 09:27 PM
RE: Area script. Help needed ! - by SilentStriker - 02-07-2012, 09:31 PM
RE: Area script. Help needed ! - by Ninami - 02-08-2012, 03:12 AM
RE: Area script. Help needed ! - by Your Computer - 02-08-2012, 03:40 AM
RE: Area script. Help needed ! - by Ninami - 02-08-2012, 04:44 AM
RE: Area script. Help needed ! - by flamez3 - 02-08-2012, 06:03 AM
RE: Area script. Help needed ! - by Ninami - 02-08-2012, 06:25 AM
RE: Area script. Help needed ! - by Your Computer - 02-08-2012, 06:31 AM
RE: Area script. Help needed ! - by Ninami - 02-08-2012, 07:37 AM
RE: Area script. Help needed ! - by Your Computer - 02-08-2012, 08:51 AM



Users browsing this thread: 1 Guest(s)