--[[ //||\\||//||\\||//||\\||//||\\||//||\\||//||\\||//||\\||//||\\||//||\\||//||\\||//||\\ Quick Companion Teleport Original Author(s): RazorShultz Link: https://www.moddb.com/mods/stalker-anomaly/addons/quick-companion-teleport-152 Edited and adapted for CoC 1.4.22 / Call of the Zone for IWP (Indev 3) ~ moonshroom //||\\||//||\\||//||\\||//||\\||//||\\||//||\\||//||\\||//||\\||//||\\||//||\\||//||\\ --]] function start_tele() if (not db.actor) then printf("Companion Teleport | companion_teleport.script | start_tele() | ERR: Unable to teleport companion -- player does not exist.") return end for id, squad in pairs(axr_companions.companion_squads) do -- Iterate through every NPC currently online and their "in a squad" status if (squad and squad.commander_id) then -- If the NPC is in a squad and there is a commander in that squad... for k in squad:squad_members() do -- Iterate through every member in that squad. local npc = db.storage[k.id] and db.storage[k.id].object -- Get the ID of the current member. if (npc and npc:alive()) then -- Check if member is alive. If yes, then... local force_set_position = level.vertex_position(db.actor:level_vertex_id()) -- Get the position of the player. if (force_set_position) then -- Check if the player is in a valid position. If yes, then... npc:set_npc_position(force_set_position) -- Set that member's position to that of the player's. end TeleportObject(k.id,db.actor:position(),db.actor:level_vertex_id(),db.actor:game_vertex_id()) -- Teleport! end end end end return false end