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