ScriptName NightVisionHotkeyScriptint bIsHotkeyPressedBegin GameMode if bIsHotkeyPressed != IsKeyPressed HotkeyGlob set bIsHotkeyPressed to IsKeyPressed HotkeyGlob if bIsHotkeyPressed ; Do stuff when the hotkey is pressed else ; Do stuff when the hotkey is released endif endifEnd
if IsImagespaceActive NightVisionISFX RemoveImagespaceModifier NightVisionISFXelseif player.GetEquipped NightVisionHelmetsList ApplyImagespaceModifier NightVisionISFXendif
if IsImagespaceActive NightVisionISFX if player.GetEquipped NightVisionHelmetsList == 0 RemoveImagespaceModifier NightVisionISFX endifendif
ScriptName NightVisionHotkeyScriptint bIsHotkeyPressedBegin GameMode if bIsHotkeyPressed != IsKeyPressed HotkeyGlob set bIsHotkeyPressed to IsKeyPressed HotkeyGlob if bIsHotkeyPressed ; Run this code when the hotkey is pressed ; Toggle night vision if IsImagespaceActive NightVisionISFX RemoveImagespaceModifier NightVisionISFX elseif player.GetEquipped NightVisionHelmetsList ApplyImagespaceModifier NightVisionISFX endif endif endif ; Remove the effect if the player stops wearing a helmet capable of night vision if IsImagespaceActive NightVisionISFX if player.GetEquipped NightVisionHelmetsList == 0 RemoveImagespaceModifier NightVisionISFX endif endifEnd