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
i forgot how to script :c
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: i forgot how to script :c

What you want is first a collide script.

Your script should look like this:

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "PlaySounds", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "TeleportToNextMap", true, 1);

}

void PlaySounds(string &in asParent, string &in asChild, int alState)
{
FadeOut(0);
AddTimer("Sound_1", 2, "CollideFunctionTimer_1");
AddTimer("Sound_2", 4, "CollideFunctionTimer_1");

}

void CollideFunctionTimer_1(string &in asTimer)
{
if(asTimer == "Sound_1")
{
PlaySoundAtEntity("Sound_1", "[SOUND].snt", "Player", 0, false);
}


if(asTimer == "Sound_2")
{
PlaySoundAtEntity("Sound_2", "[SOUND].snt", "Player", 0, false);
}
}

void TeleportToNextMap(string &in asParent, string &in asChild, int alState)
{
ChangeMap("[MAPNAME].map", "PlayerStartArea_1", "", "");
}

Replace the Bold names with what they need.

Trying is the first step to success.
(This post was last modified: 12-14-2012, 08:11 AM by FlawlessHappiness.)
12-14-2012, 08:11 AM
Find


Messages In This Thread
i forgot how to script :c - by nightsxp - 12-14-2012, 07:51 AM
RE: i forgot how to script :c - by FlawlessHappiness - 12-14-2012, 08:11 AM
RE: i forgot how to script :c - by nightsxp - 12-14-2012, 08:23 AM
RE: i forgot how to script :c - by nightsxp - 12-14-2012, 09:53 AM
RE: i forgot how to script :c - by nightsxp - 12-17-2012, 10:28 AM
RE: i forgot how to script :c - by nightsxp - 12-17-2012, 12:13 PM
RE: i forgot how to script :c - by nightsxp - 12-17-2012, 01:31 PM
RE: i forgot how to script :c - by nightsxp - 12-17-2012, 01:11 PM
RE: i forgot how to script :c - by nightsxp - 12-19-2012, 06:53 AM
RE: i forgot how to script :c - by nightsxp - 12-19-2012, 08:56 AM
RE: i forgot how to script :c - by Your Computer - 12-19-2012, 11:28 AM
RE: i forgot how to script :c - by nightsxp - 12-20-2012, 07:57 AM
RE: i forgot how to script :c - by nightsxp - 12-20-2012, 08:10 AM
RE: i forgot how to script :c - by Your Computer - 12-20-2012, 08:20 AM
RE: i forgot how to script :c - by nightsxp - 12-20-2012, 08:42 AM
RE: i forgot how to script :c - by nightsxp - 12-23-2012, 03:29 PM
RE: i forgot how to script :c - by nightsxp - 01-03-2013, 08:02 AM
RE: i forgot how to script :c - by Statyk - 01-03-2013, 08:06 AM
RE: i forgot how to script :c - by nightsxp - 01-03-2013, 08:27 AM



Users browsing this thread: 5 Guest(s)