I made a Gui tweening script that tweens the Gui out and I also made another script which tweens it in. First time I click it, it works, but then after that, the script doesn't work and the Gui doesn't move.
This is my script for tweening it to open
local lightButton = script.Parent
local lightGui = script.Parent.Parent.Parent.LightChanging
local open = script.Parent.Parent.Parent.LightChanging.Open
lightButton.MouseButton1Click:Connect(function()
if open.Value == false then
print("Button Clicked, Gui appearing!")
lightGui:TweenPosition(UDim2.new(0.744, 0,0.578, 0),Enum.EasingDirection.In, Enum.EasingStyle.Sine, 1)
open.Value = true
end
end)
Now this is my script to tween it close
local lightButton = script.Parent.Parent.Frame.ChangeLight
local Gui = script.Parent
local open = script.Parent.Open
lightButton.MouseButton1Click:Connect(function()
if open.Value == true then
print("Button Clicked, Gui dissappearing!")
Gui:TweenPosition(UDim2.new(1.1,0,0.578,0),Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1)
open.Value = false
end
end)
does anyone know why it only works once? If so could you please tell me. Any help is greatly appreciated!

2 comments
You should use one script instead of two. It easier to handle and debug when there is enough scripts.
Why doesn't it work though?!