Boolean is acting very weird

I am working on a little GUI thingy. To make sure people don’t double open it I have a boolean that gets checked/unchecked whenever the UI is opened. This is handled in 2 different local scripts. For some reason whenever I set the boolean to false after closing the UI 1 of the 2 local scripts keeps seeing it as true not allowing me to open it.

Some of the code of script 1:

local Open = Player.PlayerGui.Gamepasses.AutoClickerFrame:WaitForChild("Open")
Close.MouseButton1Click:Connect(function()
	Open.Value = false
	print(Open.Value)
	script.Parent.Parent = ReplicatedStorage
	script.Parent.Position = UDim2.new(0.287, 0, 1.1, 0)
end)

Code of script 2:

local Open = Player.PlayerGui.Gamepasses.AutoClickerFrame:WaitForChild("Open").Value
	if Owned == true then
		print(Open)
		if not Open then
			print(Open)
			local AutoClicker = ReplicatedStorage:FindFirstChild("AutoClicker")
			print(AutoClicker)
			if AutoClicker then
				AutoClicker.Parent = Player.PlayerGui.Gamepasses
				TweenUI(AutoClicker)
				print("Ran")
				Open = true
			end
		end
	else

This prints that open is true even after it being set to false in the first script.

local Open = Player.PlayerGui.Gamepasses.AutoClickerFrame:WaitForChild("Open")
This example you are initializing the “Open” INSTANCE PROPERTY.
If some property of “Open” changes, the script can get the changed property value

Open.Value

.
local Open = Player.PlayerGui.Gamepasses.AutoClickerFrame:WaitForChild("Open").Value
This example you are initializing the 'Open" instance’s property value.
Simply you are:

local Open = <true/false>

Yeah, the “Open” 's value will be changed to its property value however only once. Because you are initializing only its value, not property.
When “Open” 's property later changes, value in the script won’t change.

I hope I was useful. If you didn’t understand something or find it weird, feel free to reply because I also went through this part of the journey :grinning: