From dcf2018ec68d7325a996ffe53c02df4948d060ab Mon Sep 17 00:00:00 2001 From: Jim Shield Date: Fri, 19 Jan 2024 13:02:09 +0000 Subject: [PATCH] check for destroyProp if received any info --- functions.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/functions.lua b/functions.lua index 4efdb22..de5a59f 100644 --- a/functions.lua +++ b/functions.lua @@ -154,12 +154,14 @@ function lookEnt(entity) local ped = PlayerPedId() end function destroyProp(entity) - if Config.System.Debug then print("^6Bridge^7: ^2Destroying Prop^7: '^6"..entity.."^7'") end - if IsEntityAttachedToEntity(entity, PlayerPedId()) then - SetEntityAsMissionEntity(entity) - DetachEntity(entity, true, true) + if entity then + if Config.System.Debug then print("^6Bridge^7: ^2Destroying Prop^7: '^6"..entity.."^7'") end + if IsEntityAttachedToEntity(entity, PlayerPedId()) then + SetEntityAsMissionEntity(entity) + DetachEntity(entity, true, true) + end + DeleteObject(entity) end - DeleteObject(entity) end function pushVehicle(entity)