-- Local Script for opening the settings frame
local TweenService = game:GetService("TweenService")
local SoundService = game:GetService("SoundService")
local SettingsButton = script.Parent
local Buttons = SettingsButton.Parent
local Menu = Buttons.Parent
local Frames = Menu:WaitForChild("Frames")
local Settings_Frame = Frames:WaitForChild("SettingsFrame")
local Exit_Settings_Button = Settings_Frame:WaitForChild("ExitButton")
local Sounds = Menu:WaitForChild("Sounds")
local AppearSound = Sounds:WaitForChild("AppearSound")
local Time = AppearSound.TimeLength
local AppearInfo = TweenInfo.new(Time, Enum.EasingStyle.Linear)
local debounce = false
SettingsButton.MouseButton1Click:Connect(function()
if debounce == true then return end
debounce = true
Settings_Frame.Visible = true
AppearSound:Play()
TweenService:Create(Settings_Frame, TweenInfo.new(Time, Enum.EasingStyle.Linear), {BackgroundTransparency = 0}):Play()
for i, v in Settings_Frame:GetDescendants() do
if v:IsA("Frame") then
TweenService:Create(v, AppearInfo, {BackgroundTransparency = 0}):Play()
elseif v:IsA("TextLabel") then
TweenService:Create(v, AppearInfo, {TextTransparency = 0}):Play()
elseif v:IsA("UIStroke") then
TweenService:Create(v, AppearInfo, {Transparency = 0}):Play()
elseif v:IsA("TextButton") then
if v == Exit_Settings_Button then
Exit_Settings_Button.Interactable = true
TweenService:Create(Exit_Settings_Button, AppearInfo, {TextTransparency = 0}):Play()
continue
else
v.Interactable = true
TweenService:Create(v, AppearInfo, {BackgroundTransparency = 0}):Play()
TweenService:Create(v, AppearInfo, {TextTransparency = 0}):Play()
end
else
continue
end
end
task.spawn(function()
for i, Button in Buttons:GetChildren() do
if not Button:IsA("TextButton") then continue end
Button.Interactable = false
end
end)
task.wait(3)
debounce = false
end)
-- Local Script for exiting the Settings Frame
local TweenService = game:GetService("TweenService")
local SoundService = game:GetService("SoundService")
local ExitButton = script.Parent
local Settings_Frame = ExitButton.Parent
local Frames = Settings_Frame.Parent
local Info_Frame = Frames:WaitForChild("InfoFrame")
local Menu = Info_Frame.Parent.Parent
local Buttons = Menu:WaitForChild("Buttons")
local Sounds = Menu:WaitForChild("Sounds")
local DisappearSound = Sounds:WaitForChild("DisappearSound")
local Time = DisappearSound.TimeLength
local Disappear_Info = TweenInfo.new(Time, Enum.EasingStyle.Linear)
local debounce = false
local function Disappear()
for i, v in Settings_Frame:GetDescendants() do
if v:IsA("Frame") then
TweenService:Create(v, Disappear_Info, {BackgroundTransparency = 1}):Play()
elseif v:IsA("TextLabel") then
TweenService:Create(v, Disappear_Info, {TextTransparency = 1}):Play()
elseif v:IsA("UIStroke") then
TweenService:Create(v, Disappear_Info, {Transparency = 1}):Play()
elseif v:IsA("TextButton") then
if v == ExitButton then
ExitButton.Interactable = false
TweenService:Create(ExitButton, Disappear_Info, {TextTransparency = 1}):Play()
continue
else
v.Interactable = false
TweenService:Create(v, Disappear_Info, {BackgroundTransparency = 1}):Play()
TweenService:Create(v, Disappear_Info, {TextTransparency = 1}):Play()
end
else
continue
end
end
task.wait(Time)
Settings_Frame.Visible = false
end
ExitButton.MouseButton1Click:Connect(function()
if debounce == true then return end
debounce = true
DisappearSound:Play()
TweenService:Create(Settings_Frame, Disappear_Info, {BackgroundTransparency = 1}):Play()
task.spawn(Disappear)
task.spawn(function()
for i, Button in Buttons:GetChildren() do
if not Button:IsA("TextButton") then continue end
Button.Interactable = true
end
end)
task.wait(3)
debounce = false
end)
(Where everything is if needed)
My problem is that whenever I open the settings frame and close it really fast, the player will not be able to click on any of the menu buttons. It will just bug / glitch out and won’t work.