Frictional Games Forum (read-only)

Full Version: How to create a music area trigger?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello there! I'm new with scripting and I need help with creating an area that makes music start playing when player walks in that area. I've tried a few things but with no results. Thank you for your time!
You just need to have a script area, and script a collidecallback with it. Then use the PlayMusic function to start the music when you collide with the script area.
Can you give me an example of a working one please? Big Grin
Quote:void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea1", "MusicPlay", true, 1);

}

void MusicPlay(string &in asParent, string &in asChild, int alState)
PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);
}
Oh yeah! Big Grin Thank you really much!!! ^^