Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i break functions?

I want to end a function if you press a GUI while its running. how would i do that?

	Skip = Instance.new("TextButton",ScrnGui)
	SKip.MouseButton1Down:connect(function()
--??
	end)

2 answers

Use return.

Skip = Instance.new("TextButton",ScrnGui)
Running = false
Skip.MouseButton1Down:connect(function()
	if Running then
		return
	end
	Running = true
	
	--Your Code Here
	
	Running = false
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.