Can someone teach me how to remove created blip after a specific event? Complete nube here!
For context -This is for a pick up mission, i need the blip to dissapear once the player has picked up the briefcase.
Below is what i have currently making the blip, i just cant figure out how to remove it after the player picks up the case
Example:
SpawnCase(coords)
SpawnHostile(coords)
SetNewWaypoint(coords.x, coords.y)
local blip = AddBlipForEntity(hostile) -------making the blip
SetBlipAsFriendly(blip, false)
AddTextEntry('MYBLIP', 'Drug Deal')
BeginTextCommandSetBlipName('MYBLIP')
AddTextComponentSubstringPlayerName('me')
EndTextCommandSetBlipName(blip)
Then i tried to register an event, triggering it after picking up the case with no luck:
RegisterNetEvent(‘myscript:client:removeblip’, function()
local blip = RemoveBlipForEntity(hostile) ------------ im guessing this part is all wrong?
end)
TriggerServerEvent('myscript:server:itemadd', 'mission_briefcase', 1, false) -- add briefcase
TriggerEvent('inventory:client:ItemBox', QBCore.Shared.Items["mission_briefcase"], "add") -- notify add briefcase
TriggerEvent('myscript:client:subtitle1')
TriggerEvent('myscript:client:removeblip')
Everyones gotta start somewhere, any helps appreciated!