local destx = {} local destz = {} local state = {} local door = {} local distance_to_run_once_free = 1000 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 state[e] == "wait" then CharacterControlDucked(e) if GetPlayerDistance(e) > distance_to_run_once_free then destx[e] = g_PlayerPosX destz[e] = g_PlayerPosZ end if g_Entity[door[e]]['activated'] == 1 then CharacterControlStand(e) RotateToPlayer(e) state[e] = "free" end elseif state[e] =="free" then PromptLocal(e,"Thank you!") SetCharacterToRun(e) 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 function geisel_exit(e) end