Hi, I’ve been trying to get the screen coordinates for an entity or a world coordinate. I’ve tried using the
“GetScreenCoordFromWorldCoord”, and it seems to work sometimes, but i often get this error:
SCRIPT ERROR: @script/client.lua:5: attemp to call a nil value (global 'GetScreenCoordFromWorldCoord')
My code:
Citizen.CreateThread(function()
Citizen.Wait(1000)
local player = GetPlayerPed(-1)
local playerCoords = GetEntityCoords(player)
GetScreenCoordFromWorldCoord(
playerCoords.x --[[ number ]],
playerCoords.y --[[ number ]],
playerCoords.z --[[ number ]]
)
end)
Wondering if it could be cause of this:
If anyone has a solution, please let me know.