Frictional Games Forum (read-only)

Full Version: Phonograph and Waxroll HELP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So i am making a custom story and i want u to b able to find a waxroll record and put it in the phonograph, then crank it up and it plays music. Ive been searching for scripts and tutorials on how to do that and so far nothing has come up! Can someone plz help me!
Open a Justine's map, check its code.

Sorry i gave you a short answer but that's about it.
For the music you may need the function PlaySoundAtEntity instead of PlayMusic.
So you can center the music on the phonograph thing.
Code:
void OnStart()
{
SetLocalVarInt("PhonographWax", 0);
AddUseItemCallback("", "WaxRoll", "Phonograph", "EnablePhono", true);
SetMultiSliderCallback("Phonograph", "PlayMusic");
}

void EnablePhono(string &in asItem, string &in asEntity)
{
AddLocalVarInt("PhonographWax", 1);
}

void PlayMusic(string &in asEntity, int alState)
{
if(GetLocalVarInt("PhonographWax") == 1)
{
PlaySoundAtEntity("", "sound.snt", "Phonograph", 0.1f, false);
}

else
{
}
}