[HELP] Marker not working

Ive got this Problem… my marker ist not showing and Console says
"resource marker: @marker/client.lua:4 ‘do’ esxpected near ‘=’

pls help :frowning:

local markerPos = vector3(-34.24, -1103.26, 25.42)

Citizen.CreateThread(function()
    while ped = GetPlayerPed(-1)
    while true do
        Citizen.Wait(0)
        local playerCoords = GetEntityCoords(ped)
        local distance = #(playerCoords - markerPos)
        if distance < 100.00 then
            DrawMarker(2, markerPos.x, markerPos.y, markerPos.z + 2, 0.0, 0.0, 0.0, 0.0, 180.0, 0.0, 2.0, 2.0, 2.0, 255, 128, 0, 50, false, true, 2, nil, nil, false)
        else
            Citizen.Wait(200)
        end
    end
end)

Your line 4 says
while ped = GetPlayerPed(-1). Delete the while and you should be good to go.

Edit:
Your line 4 says while ped = GetPlayerPed(-1). You most likely wanted while to be local.

Thanks LaZy_Scripts, I really didn’t think that through before posting… :smiley:

it’s better :

local ped = GetPlayerPed(-1)

because it doesn’t need to describe a global variable to you

1 Like

Use PlayerPedId() instead of GetPlayerPed(-1) as its faster.