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.
|