Frictional Games Forum (read-only)

Full Version: Need help with script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everyone.

Can someone explain me, how to make the game play the sound, when player walks into area?

Thanks.

btw - sorry for my bad eng.
Moved to development support.
(12-27-2012, 04:59 PM)lazz3r Wrote: [ -> ]Hey everyone.

Can someone explain me, how to make the game play the sound, when player walks into area?

Thanks.

btw - sorry for my bad eng.

Code:
PlaySoundAtEntity("", "sound file with snt", "what entity the sound plays on", i use 1 often, save the sound true or false);

:)
In addition to what CptLogicDev said, since you want the sound to play when the player enters an area...

You need AddEntityCollideCallback in OnStart, like this

void OnStart()
{
AddEntityCollideCallback("Player", "YOUR AREA NAME HERE", "PlaySound", true, 1);
}

void PlaySound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "sound file with snt", "what entity the sound plays on", i use 1 often, save the sound true or false);
}

It's all in here... http://wiki.frictionalgames.com/hpl2/amn..._functions
Thanks for help.