Thank you again for a reply @SaltyGrandpa . Oddly enough the solution was to rewrite the table. This is not the solution i wanted because now i have 2 version of all my tables, just formated differently. I just could not get it to read that table.
server.lua
local blips = {
{-328.156 , 6085.16 , 31.4548},
{1695.69 , 3761.02 , 34.7053}
}
Citizen.CreateThread(function()
while true do
Citizen.Wait(60000*math.random(7,14))
thisblipis = blips[math.random(1,#blips)]
thisblip.x, thisblip.y, thisblip.z = table.unpack(thisblipis)
TriggerClientEvent('zDays:startsim', -1, {thisblip.x, thisblip.y, thisblip.z})
end
end)
client.lua
coords = {}
loc = {}
local objNameDist = 1000
RegisterNetEvent("zDays:startsim")
AddEventHandler("zDays:startsim", function(coords)
loc.x, loc.y, loc.z = table.unpack(coords)
ShowNotification("LOC recieved:\n" .. loc.x.." "..loc.y)
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(3000)
if loc ~= nil then
playerX, playerY, playerZ = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
distObj = math.floor(GetDistanceBetweenCoords(playerX, playerY, playerZ, loc.x, loc.y, loc.z, true))
if distObj ~= nil and objNameDist ~= nil and ((distObj < objNameDist)) then
startinfectionsim = true
else
startinfectionsim = false
end
end
end
end)