function onWeaponFired() { // or whatever function is being called if (player.level.name != "whatever.tig") { return; } // all the code under here}