Hey guys,
I am making a script which teleports a guy away from area 51 to random cords but when i used processLineOfSight to detect whether the land is aboveor below the player ( after the teleport , since i didnt change the z cord on teleport) but it just doesn't detect the hit. I want it to detect a world model but it doesn't detect leaving my player either below the world object or far above it after teleport. Can someone help me to detect world objects using processLineOfSight?
function detectProperPos(thePlayer)
local x,y,z = getElementPosition(thePlayer)
local hit,hitX,hitY,hitZ = processLineOfSight(x,y,z,x,y,z + 300,true,true,true,true,true,false,false,false,thePlayer,true)
if hit then
setElementPosition(thePlayer,hitX,hitY,hitZ)
setElementFrozen(thePlayer,false)
else
local shit,hitX,hitY,hitZ = processLineOfSight(x,y,z,x,y,z - 300,true,true,true,true,true,false,false,false,thePlayer,true)
if shit then
setElementPosition(thePlayer,hitX,hitY,hitZ)
setElementFrozen(thePlayer,false)
outputChatBox(hit)
else
outputChatBox("Fail")
end
end
end
Thanks,
Mann