-- LUA Script - precede every function and global member with lowercase name of script + '_main' -- Switch to open door function doorswitchcombi3_init(e) Door_Switchcombi3 = 0 SwitchActivatedCombi3 = 0 end function doorswitchcombi3_main(e) PlayerDist = GetPlayerDistance(e) if PlayerDist < 100 and g_PlayerHealth > 0 then if SwitchActivatedCombi3 == 0 then Prompt("Press E key to activate switch") if g_KeyPressE == 1 then Door_SwitchCombi3 = 1 PromptDuration("switch3 activated" ,3000) SwitchActivatedCombi3 = 1 Door_SwitchCombi1 = 0 --SwitchActivatedCombi1 = 0 end end end end