//////////////////////////// // Run first time starting map void OnStart() { AddUseItemCallback("", "AwesomeKey", "Door_Of_Doom", "UsedKeyonDoor", true); //Sets up the function, "UsedKeyonDoor". "awesome_Key" = Name i choose for the Key, "Door_Of_Doom" = Name i choose for the Door, "UsedKeyonDoor" = the Name of the function, so when i use, void UsedKeyonDoor() the game knows the "Awesome_Key" and "Door_Of_Doom" work together. AddEntityCollideCallback("Player", "Slam_Area", "SlamDoor", true, 1); //Sets up the fuction, "Slam Door". This line pretty much says, when I, "Player" enter the area i made, "Slam_Area" the game starts the fuction, "Slam Door". True means the area go away after it happens, so it can only happen once, and the 1 means when the "Player" enters the area, -1 means when the "player" exits the Area, and 0 means both. AddEntityCollideCallback("Player", "Celler_Room_Entrance", "Play_Music", false, 0); AddEntityCollideCallback("Player", "Master_Room", "Play_Music_2", false, 0); AddEntityCollideCallback("Player", "Piano_Stop", "PianoStop", true, 1); AddTimer("Pianotimer", 0, "Pianotimer"); } void UsedKeyonDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("Door_Of_Doom", false, true); PlaySoundAtEntity("", "unlock_door", "Door_Of_Doom", 0, false); RemoveItem("AwesomeKey"); } void SlamDoor(string &in asParent, string &in asChild, int alStates) { SetSwingDoorClosed("TheOneWhoSlams", true, true); } void Play_Music(string &in asParent, string &in asChild, int alState) { if(alState == 1) { PlayMusic("01_amb_darkness.ogg", true, 0.75, 3.20, 10, true); } if(alState == -1) { StopMusic(3.20, 10); } } void Play_Music_2(string &in asParent, string &in asChild, int alState) { if(alState == 1) { PlayMusic("02_amb_safe.ogg", true, 0.75, 3.20, 10, true); } if(alState == -1) { StopMusic(3.20, 10); } } void Pianotimer(string &in asTimer) { PlaySoundAtEntity("Piano", "general_Piano03", "Piano", 0, false); AddTimer("Pianotimer", 14, "Pianotimer"); } void PianoStop(string &in asParent, string &in asChild, int alState) { StopSound("Piano", 0); RemoveTimer("Pianotimer"); SetLeverStuckState("Piano", 0, true); AddPropImpulse("Piano", 0, 0, 100, "world"); SetLeverStuckState("Piano", -1, true); PlaySoundAtEntity("Piano", "break_wood", "Piano", 0, false); CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "Impact", false); GiveSanityDamage(90.00, true); }