Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function stealthy_approach(npc_id)
- if not npc_id then return end
- local enemy = db.storage[npc_id].enemy
- if enemy and enemy:id() == db.actor:id() then -- only check if actor is the enemy
- local outfit_act = db.actor:get_current_outfit()
- if outfit_act:section() == "meceniy_outfit_new" then
- if distance_between(db.actor,enemy) >= 16 then -- distance more or equal to 16 m
- db.storage[npc_id].enemy = nil -- ignore actor
- bind_stalker.hide_weapon()
- end
- else -- less than 16 m
- if db.actor:is_weapon_hidden() then
- db.actor.restore_weapon() -- only hide weapon here, else if actor detected he will be defenceless
- end
- end
- else
- if db.actor:is_weapon_hidden() then -- just incase
- db.actor.restore_weapon()
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement