Getting the backpack from a touched event

I’m trying to check if theirs a key card in the players backpack when they touch the door but it only works if they have it equipped.

local Players = game:GetService("Players")
local TouchPart = script.Parent

TouchPart.Touched:Connect(function(touched)
    if touched.Parent:IsA("Model") and touched.Parent:FindFirstChild("Humanoid") then
        local Player = Players:GetPlayerFromCharacter(touched.Parent)
        if Player.Character["Key Card"] or Player.Backpack["Key Card"] then
            print("Key card found")
        end
    end
end)

You want to use :FindFirstChild here:

Player.Character:FindFirstChild("Key Card") or Player.Backpack:FindFirstChild("Key Card")

Your script will throw an exception if there is no key card in the character since you are carelessly assuming there will be a key card doing Player.Backpack["Key Card"]