You can write your topic however you want, but you need to answer these questions:
What do you want to achieve?
I want to close the settings menu.
What is the issue?
The close button is not closing the gui. I am using a module and it works for other scripts using the module script.
What solutions have you tried so far?
I have tried changing the events but no luck so far. I looked in the Roblox Developer hub. At around 10 threads. I have looked in every single page I could find on Google. It has been ONE MONTH since this problem arose. I am getting tired of spending almost every single day of my life trying to fix this glitch. I am losing it. This might sound desperate and that is because I am.
A video that might help
Module Script
function module.tween(parent, x, ogy, close)
local function update()
if parent.Visible == true then
parent.Position = UDim2.new(x, 0, 1, 0)
local tween = parent:TweenPosition(UDim2.new(x, 0, ogy, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 1, false)
end
end
local function update2()
local tween = parent:TweenPosition(UDim2.new(x, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 1, false)
task.wait(1)
parent.Visible = false
end
close.MouseButton1Click:Connect(update2)
parent:GetPropertyChangedSignal("Visible"):Connect(update)
end
Local Script
mod = require(script.Parent.Parent:WaitForChild("Menus"))
mod.blur(script.Parent)
mod.tween(script.Parent, 0.246, 0.226, script.Parent:WaitForChild("Close"))
(mod.blur is a vaild function in the module. I just didnt show it since I don’t think it has anything to do with my problem.)
Are there any specific errors in the output? If so, could you show a screenshot of it or send in text. Have you tried using prints to see if the code in the update2 function continues to run?
local module = {}
function module.blur(parent)
-- ...
end
function module.tween(parent, x, ogy, close)
local function update()
if parent.Visible == true then
parent.Position = UDim2.new(x, 0, 1, 0)
local tween = parent:TweenPosition(UDim2.new(x, 0, ogy, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 1, false)
end
end
local function update2()
local tween = parent:TweenPosition(UDim2.new(x, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 1, false)
task.wait(1)
parent.Visible = false
end
close.MouseButton1Click:Connect(update2)
parent:GetPropertyChangedSignal("Visible"):Connect(update)
end
return module
LocalScript
mod = require(script.Parent.Parent:WaitForChild("Menus"))
mod.blur(script.Parent)
mod.tween(script.Parent, 0.246, 0.226, script.Parent:WaitForChild("Close"))
I don’t think the rest is relevant but here is the full script(the other script that was it)
local module = {}
local TS = game:GetService("TweenService")
function module.blur(parent)
local blur = game:GetService("Lighting"):WaitForChild("Blur")
parent:GetPropertyChangedSignal("Visible"):Connect(function()
if parent.Visible == true then
print("visible")
while blur.Size ~= 10 and parent.Visible == true do
blur.Size += 1
print("Changing blur... " .. blur.Size)
task.wait(0.1)
end
else
print("invisible")
while blur.Size ~= 0 and parent.Visible == false do
blur.Size -= 1
print("Changing blur... " .. blur.Size)
task.wait(0.1)
end
end
end)
end
function module.tween(parent, x, ogy, close)
local function update()
if parent.Visible == true then
parent.Position = UDim2.new(x, 0, 1, 0)
local tween = parent:TweenPosition(UDim2.new(x, 0, ogy, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 1, false)
end
end
local function update2()
print("BEEM")
local tween = parent:TweenPosition(UDim2.new(x, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 1, false)
task.wait(1)
parent.Visible = false
end
close.MouseButton1Click:Connect(update2)
parent:GetPropertyChangedSignal("Visible"):Connect(update)
end
return module
I recommend he doesn’t use that module script. Just use a normal local script.
Copy the position of the gui when it’s opened then press CTRL + U to undo so the GUI goes back where it was hidden.
Paste that position in a text file, and copy the current GUI position again.
Then you can just use a boolean value like debounce. And tween the UI
EG: