Error parsing script @esx_gang/client.lua in resource esx_gang: @esx_gang/client.lua:3: expected near ‘,’
Screenshot of the error,
Screenshot of the script (line corresponding to the error)
Read how to use for
loops properly, you’re missing the first argument of the loop so it errors out (before the comma on line 3)
local blips = {
{ name="Bullshit", colour = 4, x = 0.0, y = 0.0, z = 0.0 },
{ name="Bullshitter", colour = 5, x = 1.0, y = 1.0, z = 1.0 }
}
for _, data in pairs(blips) do
data.blip = AddBlipForCoord(data.x, data.y, data.z)
SetBlipSprite(data.blip, data.id)
SetBlipDisplay(data.blip, 4)
SetBlipScale(data.blip, 1.0)
SetBlipColour(data.blip, data.colour)
SetBlipAsShortRange(data.blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(data.title)
EndTextCommandSetBlipName(data.blip)
end
Refer to the example above to help fix your code. You don’t need to use data.blip
you can just use a local variable if you don’t need to modify it elsewhere outside the loop.