local destx = {} local destz = {} local state = {} local door = {} function geisel_init(e) state[e] = "wait" end function geisel_main(e) CharacterControlUnarmed(e) if door[e] == nil then for a = 1,1999 do if g_Entity[a] ~= nil then if weapon_name2[a] ~= nil then if weapon_name2[a] == "hostage door" then if GetDistance(e,a) < 400 then door[e] = a break end end end end end else if destx[e] == nil then StartTimer(e) destx[e] = 1 elseif destx[e] == 1 then if GetTimer(e) > 500 then destx[e] = g_PlayerPosX destz[e] = g_PlayerPosZ end else if state[e] == "wait" then CharacterControlDucked(e) if g_Entity[door[e]]['activated'] == 1 then CharacterControlStand(e) SetCharacterToRun(e) RotateToPlayer(e) state[e] = "free" end elseif state[e] =="free" then if GetPlayerDistance(e) < 300 then PromptLocal(e,"Thank you!") end AIEntityGoToPosition(g_Entity[e]['obj'],destx[e],destz[e]) --optional hide for hostages once they reach a safe distance if g_Entity[e]['x'] > destx[e] - 70 and g_Entity[e]['x'] < destx[e] + 70 and g_Entity[e]['z'] > destz[e] - 70 and g_Entity[e]['z'] < destz[e] + 70 then Hide(e) Destroy(e) state[e] = "done" end end end end end function geisel_exit(e) end