-- LUA Script - precede every function and global member with lowercase name of script + '_main' -- Switch to open door function doorswitch2_init(e) Door_Switch2 = 0 SwitchActivated2 = 0 end function doorswitch2_main(e) PlayerDist = GetPlayerDistance(e) if PlayerDist < 100 and g_PlayerHealth > 0 then if SwitchActivated2 == 0 then Prompt("Press E key to activate switch") if g_KeyPressE == 1 then Door_Switch2 = 1 PromptDuration("Doorswitch activated" ,3000) SwitchActivated2 = 1 end end end end