this fixed the error but now idk why i'm getting these when they start chasing me
i've never modified anything just those u sent me, and i did it well, no bugs, but now those error shows up, there seems to be nothing wrong as well
The clientside that has error on line 97
function chase_move(ped, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz)
if (isElement(ped)) then
local thetarget = getElementData(ped, "target")
if (getElementData(ped, "status") == "chasing") and (isElement(thetarget)) and (getElementData(ped, "slothbot") == true)
then
local pedhp = getElementHealth(ped)
local tarhp = getElementHealth(thetarget)
if pedhp > 0 and tarhp > 0 then
local tx, ty, tz = getElementPosition(thetarget)
local px, py, pz = getElementPosition(ped)
local isclear = isLineOfSightClear(px, py, pz + .6, tx, ty, tz + .6, true, false, false, true, false, false, false)
local angle = (360 - math.deg(math.atan2((tx - px), (ty - py)))) % 360 --set the peds angle to the target
setPedRotation(ped, angle)
if (isclear == true) then -- if the ped can see the target
local angle = (360 - math.deg(math.atan2((tx - px), (ty - py)))) % 360 --set the peds angle to the target
setPedRotation(ped, angle)
setElementData(ped, "seestarget", true)
setTimer(chase_move, 700, 1, ped, tx, ty, tz, px, py, pz)
else
--THIS IS LINE 97 local angle = (360 - math.deg(math.atan2((oldTx - px), (oldTy - py)))) % 360 --set the peds angle to the target
setPedRotation(ped, angle)
setElementData(ped, "seestarget", false)
setTimer(chase_move, 700, 1, ped, oldTx, oldTy, oldTz, px, py, pz)
end
end
end
end
end
also in server this is line 251 and 252, there really seems to be nothing wrong:
function chase_move(ped, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) -- function name that has the oldTx variable, i cant post the full chase move function ,its too long, but if u insist i can send it
local pdistance = (getDistanceBetweenPoints3D(oldPx, oldPy, oldPz, px, py, pz)) -- line 251
if (pdistance < 1.2) then -- line 252