Hello guys, so basically i downloaded the Freeroam Script, and when i try to double click teleport with the map the screen goes black, If i change my skin with /ss, i get teleported to X 0 Y 0 Z 0.
I turned on script debug mode. Error:
WARNING: mfsz_fun/fr_client.lua:762: Bad argument @ 'processLineOfSight' [Expected vector 3 at argument 1, got nil] [DUP x11]
Script:
function setPlayerPosition(x, y, z)
local elem = getPedOccupiedVehicle(g_Me)
local distanceToGround
local isVehicle
if elem and getPedOccupiedVehicle(g_Me) then
local controller = getVehicleController(elem)
if controller and controller ~= g_Me then
errMsg('Only the driver of the vehicle can set its position.')
return false
end
distanceToGround = getElementDistanceFromCentreOfMassToBaseOfModel(elem) + 3
isVehicle = true
else
elem = g_Me
distanceToGround = 0.4
isVehicle = false
end
local hit, hitX, hitY, hitZ = processLineOfSight(x, y, 3000, x, y, -3000) <-- LINE 762
if not hit then
if isVehicle then
server.fadeVehiclePassengersCamera(false)
else
fadeCamera(false)
end
if isTimer(g_TeleportMatrixTimer) then killTimer(g_TeleportMatrixTimer) end
g_TeleportMatrixTimer = setTimer(setCameraMatrix, 1000, 1, x, y, z)
if not grav then
grav = getGravity()
setGravity(0.001)
end
if isTimer(g_TeleportTimer) then killTimer(g_TeleportTimer) end
g_TeleportTimer = setTimer(
function()
local hit, groundX, groundY, groundZ = processLineOfSight(x, y, 3000, x, y, -3000)
if hit then
local waterZ = getWaterLevel(x, y, 100)
z = (waterZ and math.max(groundZ, waterZ) or groundZ) + distanceToGround
if isPedDead(g_Me) then
server.spawnMe(x, y, z)
else
server.setMyPos(x, y, z)
end
setCameraPlayerMode()
setGravity(grav)
if isVehicle then
server.fadeVehiclePassengersCamera(true)
else
fadeCamera(true)
end
killTimer(g_TeleportTimer)
g_TeleportTimer = nil
grav = nil
end
end,
500,
0
)
else
if isPedDead(g_Me) then
server.spawnMe(x, y, z + distanceToGround)
else
server.setMyPos(x, y, z + distanceToGround)
if isVehicle then
setTimer(setElementVelocity, 100, 1, elem, 0, 0, 0)
setTimer(setVehicleTurnVelocity, 100, 1, elem, 0, 0, 0)
end
end
end
end