I have the following module:
local module = {}
function module.Startup(Screen, On)
if On == false then
On = true
Screen.Enabled = true
Screen.Loading.Visible = true
wait(1)
Screen.Loading.Logo.Visible = true
wait(2)
Screen.Loading.ProgressBar.Visible = true
Screen.Loading.ProgressBox = true
local y = 0
while y < 1 do
y = y + 0.01
Screen.Loading.ProgressBar.Size = UDim2.new(y ,0 ,0, 10)
if On == false then
break
end
wait()
end
else
On = false
Screen.Enabled = false
Screen.Loading.Visible = false
Screen.Loading.Logo.Visible = false
Screen.Loading.ProgressBar.Visible = false
Screen.Loading.ProgressBox.Visible = false
Screen.Loading.ProgressBar.Size = UDim2.new(0, 0, 0, 10)
end
end
return module
And the script that requires it, inside a button:
local Screen = script.Parent.Parent.Screen.Screen
local Functions = require(script.Parent.Parent.Functions)
local On = script.Parent.Parent.On
script.Parent.ClickDetector.MouseClick:Connect(function() Functions.Startup(Screen, On) end)
When the button is pressed nothing happens, On's value doesn't even change. No errors, nothing in output. What's wrong?

2 comments
If the button is a GUI you should use MouseButton1Click. If that was intended, I probably misinterpreted what the script is doing.
its a union