Check if blip is on map

How would I go about checking if blip is on the map already? I have client script checking to see if a house is bought and if it is not bought put a blip on the map and if it is bought take it off. Only problem is it just keeps adding more blips even though one exist already. It checks every 5 minutes if it needs to take or add a blip

Hey ! :slightly_smiling_face:

Can you show us part of your code ? It would be easier for us to help you that way.

I wrote an exemple that you could possibly use while waiting to see your code :

--I am defining a Blip
yourHouseBlip = AddBlipForCoord(1000,1000,1000)

--My thread that will check every 5 minutes if the blip exists
Citizen.CreateThread(function()
	while true do
	
		--Every 5 minutes
		Citizen.Wait(5*60000)
		--Check the existence of the blip
		blipExists = DoesBlipExist(yourHouseBlip)
		
		--If it doesn't already exist
		if(not blipExists) then
			--Then create it
			yourHouseBlip = AddBlipForCoord(1000,1000,1000)
		else
		  --you can do something that you want if it already exist here
		end
	
	end
	
end)
1 Like