Script not detecting if the model is in folder but instead gives me a warning that its not a valid member

I made something that when not found in a specified place it fires a remote event that make a gui warning that its not in there, I tried alot of things but it didnt work, it just give me a warning that its not part of it even if a typed if not, heres my script:

script.Parent.Triggered:Connect(function(plr)
	if not plr:WaitForChild("Inventory").Wallet then
		game.ReplicatedStorage.ErrorRE:FireClient("no card")
		return
	else 
		plr:WaitForChild("PlayerGui").inGame.Swiper.Visible = true
	end
end)

try this

script.Parent.Triggered:Connect(function(plr)
	if not plr:WaitForChild("Inventory"):FindFirstChild("Wallet") then
		game.ReplicatedStorage.ErrorRE:FireClient("no card")
		return
	else 
		plr:WaitForChild("PlayerGui").inGame.Swiper.Visible = true
	end
end)