06-16-2014, 10:15 PM
the music from the first level is still playing in the 2nd level...this is my script.
--------------
01_UnTold.hps
--------------
void OnStart()
{
PlayMusic("10_amb", true, 4.3, 7, 0, true);
AddUseItemCallback("", "Key_01", "Door_01", "DoorUnlock", true);
AddEntityCollideCallback("Player", "Script", "Music", true, 1);
}
void DoorUnlock(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "Unlock_Door.snt", asEntity, 0, false);
RemoveItem(asItem);
}
void Music(string &in asParent, string &in asChild, int alState)
{
PlayMusic("dan_Brute", true, 3.2, 8, 10, true);
}
void OnEnter()
{
}
void OnLeave()
{
}
--------------
02_UnTold.hps
--------------
void OnStart()
{
PlayMusic("01_amb_darkness", true, 4.3, 7, 1, true);
}
void DoorLockedPlayer(string &in entity)
{
GetSwingDoorLocked("DoorMessage");
SetMessage("Sign", "msgname", 0);
}
void OnEnter()
{
}
void OnLeave()
{
}
--------------
01_UnTold.hps
--------------
void OnStart()
{
PlayMusic("10_amb", true, 4.3, 7, 0, true);
AddUseItemCallback("", "Key_01", "Door_01", "DoorUnlock", true);
AddEntityCollideCallback("Player", "Script", "Music", true, 1);
}
void DoorUnlock(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "Unlock_Door.snt", asEntity, 0, false);
RemoveItem(asItem);
}
void Music(string &in asParent, string &in asChild, int alState)
{
PlayMusic("dan_Brute", true, 3.2, 8, 10, true);
}
void OnEnter()
{
}
void OnLeave()
{
}
--------------
02_UnTold.hps
--------------
void OnStart()
{
PlayMusic("01_amb_darkness", true, 4.3, 7, 1, true);
}
void DoorLockedPlayer(string &in entity)
{
GetSwingDoorLocked("DoorMessage");
SetMessage("Sign", "msgname", 0);
}
void OnEnter()
{
}
void OnLeave()
{
}