-- Simple demonstration which slides the ped along the x and y axis until the ped is outside the given area
local offset = 10
while IsEntityAtCoord(PlayerPedId(), coords.x, coords.y, coords.z, 20.0, 20.0, 20.0, false, false, 0) do
offset += 0.1
local targetCoords = coords + vector3(offset, offset, 0)
SetEntityCoords(PlayerPedId(), targetCoords.x, targetCoords.y, targetCoords.z)
Citizen.Wait(0)
end
print(i) -- Prints 20.1, as expected