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

How To Make a Script Where You Click Once It Does Something, But When You Click The Second Time...?

How To Make a Script Where You Click Once It Does Something, But When You Click The Second Time It Does Something Else? I tried this, but of course it doesn't work...

function onClicked()
	--Code
	function onClicked()
		--Code
	end
end

script.Parent.MouseButton1Click:connect(onClicked)

Thank You!

1 answer

I Would make 1 variable that every time you click something it goes up try this

script.Parent.MouseButton1Click:connect(function()

local clicks = 0
clicks = clicks + 1

code
code
code



if clicks == 2 then

	The Code That you want to do at the second click

end

end)

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