Been trying to make a gui for a game with a loop and the button would make a loop every 1 second but I don't know how I would break the loop with another button.
You could use something like
while script.BoolValue.value == true do -- your loop -- end
and change the BoolValue
to false when you want to break it.