Any help with checking tooltips?

I want this to print (“dog”) if the tool the player is holding’s tooltip says “M1911”, etc. But im getting an error saying TOolTip not a valid member of part, any help?

script.Parent.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local plr = workspace[hit.Parent.Name] --Access character from workspace.
        local player = game.Players:GetPlayerFromCharacter(plr) --Access (plr)
	local Tools = plr:GetChildren()
        	for i = 1, #Tools do
		if Tools[i].ClassName == Tools[i].ToolTip == "M1911" or Tools[i].ClassName == "Glock" and Tools[i].ToolTip == "Rossi" then
			print("dog")
        end
    end
end
end)

Tools here is every child of the Character that hit the part, this is going to include more than just tools.
Try

local children = plr:GetChildren()
for i, v in pairs(children) do
    if v:IsA("Tool") then
        if  v.ToolTip == "M1911" then -- add more conditions if necessary
            print("dog")
		end
	else
		print(string.format("%s is not a Tool!", v.Name))
    end  
end

Another edit: I forgot a second end, whoopsie.

This is giving me the same error as before when trying to add more.

script.Parent.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local plr = workspace[hit.Parent.Name] --Access character from workspace.
        local player = game.Players:GetPlayerFromCharacter(plr) --Access (plr)
local children = plr:GetChildren()
for i, v in pairs(children) do
    if v:IsA("Tool") and v.ToolTip == "M1911" or v.ToolTip == "Glock" then -- add more conditions if necessary
        print("dog")
end
end
    end
end)

Sorry, I had a mistake in my code, it should be good now after the edit.

The tool will only be in the player if it is equipped, and if not it will be in the backpack.

I would iterate through a table of acceptable values instead of just adding boolean arguments.

I only want it to be the ones equipped.

@ThousandDegreeKnife
That’s a very good point that I hadn’t considered. (not much experience with player backpacks…)

Here’s a modified script that uses a hardcoded list of valid tooltip strings. When the part is touched, it checks the character for a Tool. If it finds one, it checks if the tool’s ToolTip is valid. If it is, it will print to the console.

local ValidItemToolTips = {"M1911", "Gun"}
local debounce = false

script.Parent.Touched:Connect(function(hit)
	local humanoid = hit.Parent:FindFirstChild("Humanoid")
	if humanoid ~= nil and not debounce then
		local character = humanoid.Parent
		local objectsInPlayer = character:GetChildren()
		for i, item in pairs(objectsInPlayer) do
			if item:IsA("Tool") then
				debounce = true
				for _, tooltip in pairs(ValidItemToolTips) do
					if tooltip == item.ToolTip then
						print(string.format("%s with ToolTip %s is a valid item!", item.Name, tooltip))
					end
				end
				wait(2)
				debounce = false
			end
		end		
	end
end)