-- DESCRIPTION: Check distance travelled local oldplrPos = 0 local newplrPos = 0 local dis_traveled = 0 local tPlayerDX = 0 local tPlayerDY = 0 local tPlayerDZ = 0 local x,y,z = 0,0,0 function distance_traveled_init(e) x = GetPlrObjectPositionX() y = GetPlrObjectPositionY() z = GetPlrObjectPositionZ() oldplrPos = math.sqrt(math.abs(x^2)+math.abs(y^2)+math.abs(z^2)) end function distance_traveled_main(e) Prompt("dis_traveled: " ..round(dis_traveled,1)) if GetGamePlayerControlMovement() then tPlayerDX = (GetPlrObjectPositionX()) tPlayerDY = (GetPlrObjectPositionY()) tPlayerDZ = (GetPlrObjectPositionZ()) newplrPos = math.sqrt(math.abs(tPlayerDX^2)+math.abs(tPlayerDY^2)+math.abs(tPlayerDZ^2)) dis_traveled = newplrPos-oldplrPos --if dis_traveled > 1000 then Prompt("1000k reached") end end end --main function round(num, idp) local mult = 10^(idp or 0) return math.floor(num * mult + 0.5) / mult end