Frictional Games Forum (read-only)

Full Version: Music OnStart?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do I get music to play as soon as the player enters the map? It's just ambient music, nothing special.
(10-01-2012, 09:34 AM)srobb Wrote: [ -> ]How do I get music to play as soon as the player enters the map? It's just ambient music, nothing special.
void OnEnter()
{
PlayMusic("track_you_want_to_play.ogg", true, 2, 2, 0, true);
}
main (8, 1) : ERR : Unexpected token '{'
Line 8 is just '{'.


void OnEnter()
{
PlayMusic("29_amb.ogg", true, 2, 2, 0, true);
}
(10-01-2012, 10:11 AM)srobb Wrote: [ -> ]main (8, 1) : ERR : Unexpected token '{'
Line 8 is just '{'.


void OnEnter()
{
PlayMusic("29_amb.ogg", true, 2, 2, 0, true);
}
Could you show me your whole script.
void OnStart()
{

}

void OnEnter()
{
PlayMusic("29_amb.ogg", true, 2, 2, 0, true);
}

void OnLeave()
{


}

This should make no problem at all... It must've been something your script
////Onstartmap

void OnStart()
{

}

void OnEnter()
{
PlayMusic("29_amb.ogg", true, 2, 2, 0, true);
}

Still won't work. It says "main (13, 1) : ERR: Unexpected token '{'.
Line 13 is just a {. I don't get what I've done wrong? Everything was working fine until I put the PlayMusic script in.
Can you post the whole script, please?
Nevermind, I got it working.
Thanks Smile