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