--[[ LUA Script converted from FPSC to GameGuru by M.Fowler (c) 2017 Original FPI file can be found under: C:\Program Files (x86)\The Game Creators\FPS Creator\Files\scriptbank\Kasseyus\Space Derelict\KillCount Door.fpi ]] --[[ desc = Door will Open After Kill Count Reached ]] g_varindex = {} for idx = 0 , 99 do i=idx ; vname = 'var'..idx ; vval = 0; g_varindex[idx]={i=i ; vname = vname; vval=vval ;} end function killcountdoor_init(e) doorstate = 0 ; end function killcountdoor_main(e) if ALWAYS()==1 then GLOBALVAR = 7 end if doorstate == 0 and GLOBALVAR == 7 and GVAREQUAL(GLOBALVAR) == 2 then doorstate = 1 SetAnimationFrame(e,0) PlaySound(e,0) end if doorstate == 1 then SetAnimationFrame(e,g_Entity[e]['frame']+1) end if doorstate == 1 and g_Entity[e]['frame'] == GetEntityAnimationFinish(e,0) then doorstate = 2 CollisionOff(e) end --PromptLocal (e,'doorstate=' .. doorstate .. ' kill=' .. GVAREQUAL(GLOBALVAR)) end function killcountdoor_exit(e) end --FPSC legacy conditional command->ALWAYS function ALWAYS() return 1 end --FPSC legacy conditional command->GVAREQUAL function GVAREQUAL(gvar) return g_varindex[gvar]['vval'] end