# Blips

HapticLib provides self cleaning blips and its extremely easy to use. Rather than generating each blip manually in your script. You can use the lib

Previous Blip Generation Example

<pre class="language-lua"><code class="lang-lua"><strong>if v.blip_enabled then
</strong><strong>     local blip = AddBlipForCoord(v.blip_location)
</strong>     SetBlipAsShortRange(blip, true)
     SetBlipSprite(blip, v.blip_sprite)
     SetBlipScale(blip, v.blip_scale)
     SetBlipDisplay(blip, 6)
     BeginTextCommandSetBlipName('STRING')
     AddTextComponentString(v.blip_name)
     EndTextCommandSetBlipName(blip)
end

</code></pre>

You can pass the same parameters to the Lib and not have to worry about cleaning up blips.

<pre class="language-lua"><code class="lang-lua">-- Function
<strong>HapticLib.CreateBlip(uniqueid, coords, shortrange, sprite, scale, name, color)
</strong>
-- Usage
-- You always want to parse a uniqueid to the library so that it can clean up
local uniqueid = "Cityhall_" .. HapticLib.GenerateString(4)
HapticLib.CreateBlip(uniqueid, v.blip_location, v.blip_shortrange, v.blip_sprite, v.blip_scale, v.blip_name, v.blip_color)

</code></pre>

To Remove a blip in runtime you can also do.

```lua
HapticLib.RemoveBlip(UniqueID) -- This is why setting uniqueid's is important
```
