getNearestPed
local nearestPed, pedDistance = ps.getNearestPed()
if nearestPed ~= 'no nearby ped' then
print("Found ped at distance: " .. pedDistance)
end
-- With custom parameters
local coords = vector3(100.0, 200.0, 30.0)
local ped, dist = ps.getNearestPed(coords, 15.0)Last updated