The problem is that getElementPosition returns exact coordinates (in this case X coordinate is "-715.83142089844").
And you are comparing it with "-715.8314".
To make it work you will have to round the coordinates.
You can either use the useful function math.round or do it like this:
local theBlip = createBlip(-715.8314, 2328.1269, 44.1525, 41, 2, 255, 0, 0, 255, 0, 1000)
function removeBlip(posX, posY, posZ)
for _,blip in ipairs(getElementsByType("blip")) do
local x,y,z = getElementPosition(blip)
if(math.ceil(posX) == math.ceil(x) and math.ceil(posY) == math.ceil(y) and math.ceil(posZ) == math.ceil(z)) then
destroyElement(blip)
end
end
end
addCommandHandler("blip", function () -- the cmd way is for an example
removeBlip(-715.8314, 2328.1269, 44.1525)
end)
*Changed @Burak5312's code a bit.
Note that this way it won't be very accurate but if you don't plan to have close blips it should not cause any problems.
Otherwise use the math.round function I mentioned above and specify how many digits to have after the decimal point.