I have the module script:
local module = {}
function module.StartUp(blox)
local gui = blox.Screen.StartUp
local rotate = gui.Frame.ImageLabel
local y = 1
local on = false
local button = blox.onoff
if on == false then
on = true
button.Material = Enum.Material.Neon
gui.Enabled = true
wait(2)
rotate.Visible = true
y = 1
rotate.Rotation = 0
while y < 1000 do
y = y + 1
rotate.Rotation = y
if on == false then
break
end
wait(.01)
end
else
button.Material = Enum.Material.SmoothPlastic
on = false
gui.Enabled = false
rotate.Visible = false
end
end
return module
The startup function is supposed to trigger when the button that parents the following script is clicked:
local click = script.Parent.ClickDetector
module = require(script.Parent.Parent.functions)
click.MouseClick:connect(module.StartUp(script.Parent.Parent))
But it just runs when the game starts, why and what can I do about that?

4 comments
Thank you :)
Ewww who uses ;
Maybe he's used to C++ or another language that requires a ";" after a function is called.
Literally, most languages use ; and I used Java before so, I want to make it a habit to use it.