void OnStart()
{
PlaySoundAtEntity("", "general_piano01.snt", "Player", 0.0f, false);
PlayMusic("02_amb_safe.ogg", true, 1.0f, 0, 0, true);
AddEntityCollideCallback("Player", "Flaska", "PlaySound", true, 1);
AddEntityCollideCallback("Player", "Ljud", "start", true, 1);
AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true);
AddUseItemCallback("", "Nyckel", "Rumpa", "UseKeyOnDoor", true);
AddUseItemCallback("", "Tillskåp", "Skåp", "UseKeyOnDoor", true);
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "Unlock_door.snt", asEntity, 10, false);
RemoveItem(asItem);
}
void start(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "general_piano01.snt", "Player", 1, false);
}
void PlaySound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "21_intro_scream.snt", "Player", 1, false);
}
I was able to load the map but now when i enter an area general_piano01.snt, 02_amb_safe.ogg, 21_intro_scream.snt plays at the same time, lol. How does one separate these to play in their respective areas? I know you're suppose to name the area but i don't really see the solution in the script.