Hey guys. I can’t for the life of me figure out why my script isn’t working. What I want it to do is grab the x,y,z coords of the banks and put blips on the map for them. I have searched the forums and every example script has similar content. Here is what I have.
local banks = {
{name="Bank", id=108, x=150.266, y=-1040.203, z=29.374},
{name="Bank", id=108, x=-1212.980, y=-330.841, z=37.787},
{name="Bank", id=108, x=-2962.582, y=482.627, z=15.703},
{name="Bank", id=108, x=-112.202, y=6469.295, z=31.626},
{name="Bank", id=108, x=314.187, y=-278.621, z=54.170},
{name="Bank", id=108, x=-351.534, y=-49.529, z=49.042},
{name="Bank", id=108, x=241.727, y=220.706, z=106.286},
{name="Bank", id=108, x=1175.0643310547, y=2706.6435546875, z=38.094036102295}
}
AddEventHandler("playerSpawned", function(spawn)
Citizen.CreateThread(function()
TriggerEvent("chatMessage", "", { 0, 0, 0 }, "Blips loading")
while true do
Citizen.Wait(0)
for k in pairs(banks) do
local bankBlips = AddBlipForCoord(banks[k].x, banks[k].y, banks[z].z)
SetBlipSprite(bankBlips, banks[k].id)
SetBlipDisplay(bankBlips, 2)
SetBlipScale(bankBlips, 1)
SetBlipColour(bankBlips, 2)
SetBlipAsShortRange(bankBlips, false)
BeginTextCommandSetBlipName("String")
AddTextComponentString(banks[k].name)
EndTextCommandSetBlipName(bankBlips)
end
TriggerEvent("chatMessage", "", { 0, 0, 0 }, "Blips loaded")
end
end)
end)