luafivemlua-5.1

FiveM 'then' expected near '='


Hello when i start the server and want to start doing illegal jobs this shows up

brx-drugs/client/client.lua:50: 'then' expected near '='

and here is also a piece of the code

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(1000)
        local pedCoords = GetEntityCoords(GetPlayerPed(-1))
        local dst = #(Config.StartLocation - pedCoords)
        if dst < 200 and jobSpawned = false then
            TriggerEvent ('brx-drugs:spawnJobPed',Config.StartLocation, 217.980
            jobSpawned = true
            refreshJobPed = true
        end
        if dst>= 201 then
            if DoesEntityExist(jobPed) then
                DeletePed(jobPed)
            end
            JobSpawned = false

        end
    end
end)

i dont think the problem is with the config file and i cant get around it since im a new dev


Solution

  • Missing '=' in

    if dst < 200 and jobSpawned = false then

    jobSpawned = false

    Change to

    jobSpawned == false