If statement doesn't work with "and"

I have tried this many times and tried to find a simular problem but I didn’t find anything

this is my script right now

wait(12)
local check1 = script.Parent.Parent.Lock.Lock.Locked
local check2 = script.Parent.Parent.Lock2.Lock.Locked

local Plank = script.Parent
if check1 == true and check2 == true then
	local CD = Instance.new("ClickDetector")
	CD.Parent = Plank
	CD.CursorIcon = "http://www.roblox.com/asset?id=5992580992"
	local HighLight = Plank.Highlight

	CD.MouseHoverEnter:Connect(function()
		HighLight.Enabled = true
	end)
	CD.MouseHoverLeave:Connect(function()
		HighLight.Enabled = false
	end)
end

the checks are bool values and I checked the bools in game if they are true and they were, my script just doesnt work

You are checking if the instance exists, you forgot to add .Value

try change your variables to this
local check1 = script.Parent.Parent.Lock.Lock.Locked.Value
local check2 = script.Parent.Parent.Lock2.Lock.Locked.Value

oof I totally forgat to add that tysm that was 1 of the most be one of the most stupid things I have ever done

Don’t worry about it, I used to do it ALL the time.