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.