Code: Select all
Player.getNearest(x,y)
Code: Select all
function onTick()
-- ...
snpc = ... -- self NPC
-- ...
local p = Player.getNearest(snpc.momentum.x + snpc.momentum.w, snpc.momentum.y + snpc.momentum.h)
if(p)
-- Do some logic with player object "p"
end
-- ...
end