[Solved] LUA Script for blips not working


#1

Hi, I am trying to make some blips on the map. It is not working for me for whatever reason. Here is the script.

local blips = {
    -- Example {title="", colour=, id=, x=, y=, z=},

     {title="Weed Farm", colour=0, id=140, x = 1609.125, y = 6663.5942382813, z = 20.961572647095},
     {title="Weed Treatment", colour=0, id=140, x = 91.061386108398, y = 3750.0380859375, z = 39.77326965332},
	 {title="Weed Resell", colour=0, id=140, x = -54.249694824219, y = -1443.3666992188, z = 31.068626403809},
     {title="Opium Farm", colour=0, id=51, x = 1972.784790039, y = 3819.3999023438, z = 33.428722381592},
	 {title="Opium Treatment", colour=0, id=51, x = 971.86499023438, y = -2157.61328125, z = 28.475107192994},
     {title="Opium Resell", colour=0, id=51, x = 2331.0881347656, y = 2570.2250976562, z = 46.681819915772},
	 {title="Meth Farm", colour=0, id=51, x = 1525.298828125, y = 1710.0217285156, z = 109.00956726074},
     {title="Meth Treatment", colour=0, id=51, x = -1001.4151611328, y = 4848.0087890625, z = 274.00686645508}
	 {title="Meth Resell", colour=0, id=51, x = -63.592178344727, y = -1224.0709228516, z = 27.768648147583},
     {title="Coke Farm", colour=0, id=51, x = 2448.9228515625, y = -1836.8076171875, z = 51.953701019287},
	 {title="Coke Treatment", colour=0, id=51, x = -458.13967895508, y = -2278.6174316406, z = 7.5158290863037},
     {title="Coke Resell", colour=0, id=51, x = -1756.1984863281, y = 427.31674194336,  z = 126.68292999268}
	 
  }
      
Citizen.CreateThread(function()

    for _, info in pairs(blips) do
      info.blip = AddBlipForCoord(info.x, info.y, info.z)
      SetBlipSprite(info.blip, info.id)
      SetBlipDisplay(info.blip, 4)
      SetBlipScale(info.blip, 1.0)
      SetBlipColour(info.blip, info.colour)
      SetBlipAsShortRange(info.blip, true)
	  BeginTextCommandSetBlipName("STRING")
      AddTextComponentString(info.title)
      EndTextCommandSetBlipName(info.blip)
    end
end)

#2
local blips = {
    -- Example {title="", colour=, id=, x=, y=, z=},

     {title="Weed Farm", colour=0, id=140, x = 1609.125, y = 6663.5942382813, z = 20.961572647095},
     {title="Weed Treatment", colour=0, id=140, x = 91.061386108398, y = 3750.0380859375, z = 39.77326965332},
	 {title="Weed Resell", colour=0, id=140, x = -54.249694824219, y = -1443.3666992188, z = 31.068626403809},
     {title="Opium Farm", colour=0, id=51, x = 1972.784790039, y = 3819.3999023438, z = 33.428722381592},
	 {title="Opium Treatment", colour=0, id=51, x = 971.86499023438, y = -2157.61328125, z = 28.475107192994},
     {title="Opium Resell", colour=0, id=51, x = 2331.0881347656, y = 2570.2250976562, z = 46.681819915772},
	 {title="Meth Farm", colour=0, id=51, x = 1525.298828125, y = 1710.0217285156, z = 109.00956726074},
     {title="Meth Treatment", colour=0, id=51, x = -1001.4151611328, y = 4848.0087890625, z = 274.00686645508},
	 {title="Meth Resell", colour=0, id=51, x = -63.592178344727, y = -1224.0709228516, z = 27.768648147583},
     {title="Coke Farm", colour=0, id=51, x = 2448.9228515625, y = -1836.8076171875, z = 51.953701019287},
	 {title="Coke Treatment", colour=0, id=51, x = -458.13967895508, y = -2278.6174316406, z = 7.5158290863037},
     {title="Coke Resell", colour=0, id=51, x = -1756.1984863281, y = 427.31674194336,  z = 126.68292999268}
	 
  }
      
Citizen.CreateThread(function()

    for _, info in pairs(blips) do
      info.blip = AddBlipForCoord(info.x, info.y, info.z)
      SetBlipSprite(info.blip, info.id)
      SetBlipDisplay(info.blip, 4)
      SetBlipScale(info.blip, 1.0)
      SetBlipColour(info.blip, info.colour)
      SetBlipAsShortRange(info.blip, true)
	  BeginTextCommandSetBlipName("STRING")
      AddTextComponentString(info.title)
      EndTextCommandSetBlipName(info.blip)
    end
end)

Meth Treatment line was missing a comma


#3

Thanks so much! (20char)