I got the error and dont know whats working wrong can someone help me?
error line:
– Iterate through all the mines
for i, mine in ipairs(mines) do
Code:
– Function to check if a vehicle is on a mine
function checkMines()
– Iterate through all the mines
for i, mine in ipairs(mines) do
– Check if there’s a vehicle on the mine
if DoesEntityExist(mine) then
local x, y, z = table.unpack(GetEntityCoords(mine))
local nearbyVehicle = GetClosestVehicle(x, y, z, 2.0, 0, 70)
if DoesEntityExist(nearbyVehicle) then
– Explode the mine
SetEntityAsMissionEntity(mine, true, true)
DeleteObject(mine)
-- Create explosion effect
x, y, z = table.unpack(GetEntityCoords(nearbyVehicle))
AddExplosion(x, y, z, 3, 1.0, true, false, 1.0)
-- Remove the mine from the table
table.remove(mines, i)
end
end
end
end
if u need more informations about the script just drop it down will reply with the code