Script dont work in car

Hi guys can you help me make this script work also if the player is seated in a car thx `local ItemName = “Pumpkin”
local Chance = 0.01

script.Parent.Touched:Connect(function(part)
if part.Parent and part.Parent:FindFirstChildOfClass(“Humanoid”) then
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if player then
if math.random() <= Chance then
local backpack = player:FindFirstChildOfClass(“Backpack”)
if backpack and backpack:FindFirstChild(ItemName) then – Check in backpack
backpack[ItemName]:Destroy()
else if part.Parent:FindFirstChild(ItemName) then – Check in character
part.Parent[ItemName]:Destroy()
end
end
end
end
end
end)`