Issue with comparing values

My problem is very simple, however I’m completely stumped as to why it’s not working. Here is my very short code which is supposed to check if the player who is unlocking a door is the same player who owns the house.

	if Lock.Value == true then -- if the door is locked
		if p.Parent.Name == "HouseKey" then -- if the touching part is the key
			if p.Parent.Parent == script.Parent.Parent.Parent.Parent.Parent:FindFirstChild("BuyHouse1").Owner.Value then
				Lock.Value = false

when I print (p.Parent.Parent, script.Parent.Parent.Parent.Parent.Parent:FindFirstChild(“PurchaseHouse”).Owner.Value) it comes out correctly comparing the player values, yet my code doesn’t work?

It’s because you are calling the player’s Character at p.Parent.Parent, and then comparing it to another value that has the player or their name, unless it is an object value. Try adding p.Parent.Parent.Name instead, and let me know if it works