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

How can i break a repeat until the same button is pressed?

I am making a modded menu sort of thing and i need to know how to break this loop and change the texts back to white and the button text to OFF with the same button how could i do this?

on7.MouseButton1Click:connect(function()
local running = true
	on7.Text = "ON"
	on7.TextColor3 = Color3.new(0,170,0)
		repeat
			wait(0.1)
			espt.TextColor3 = Color3.new(math.random(),math.random(),math.random())
			godmode.TextColor3 = Color3.new(math.random(),math.random(),math.random())
			jump.TextColor3 = Color3.new(math.random(),math.random(),math.random())
			speed.TextColor3 = Color3.new(math.random(),math.random(),math.random())
			teleport.TextColor3 = Color3.new(math.random(),math.random(),math.random())
			xray.TextColor3 = Color3.new(math.random(),math.random(),math.random())
			rainbowmenu.TextColor3 = Color3.new(math.random(),math.random(),math.random())
			noclipT.TextColor3 = Color3.new(math.random(),math.random(),math.random())
			teamT.TextColor3 = Color3.new(math.random(),math.random(),math.random())
			raycastT.TextColor3 = Color3.new(math.random(),math.random(),math.random())
			autoupdateT.TextColor3 = Color3.new(math.random(),math.random(),math.random())
			addespT.TextColor3 = Color3.new(math.random(),math.random(),math.random())
			
			-------------------------------------------------------------------------------
			espt.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
			godmode.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
			jump.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
			speed.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
			teleport.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
			rainbowmenu.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
			xray.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
			noclipT.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
			teamT.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
			raycastT.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
			autoupdateT.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
			addespT.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
			
		until running == false

end)

4 comments

0

You code blocked improperly, try to make sure ALL the code is withing the '~~~~~~~~~~~~' lines

0

I don't understand your question, the loop already breaks when your running variable == false.

0

oh my bad i put in the wrong thing lol

0

So what i mean is how can i toggle this

1 answer

sounds like your writing an exploit. Anyways, try this.


running = false

on7.MouseButton1Click:connect(function()
	running = not running
	if running then
		on7.Text = "ON"
	else
		on7.Text = "OFF"
	end
end)

spawn(function()
	while running do
		wait(0.1)
        espt.TextColor3 = Color3.new(math.random(),math.random(),math.random())
        godmode.TextColor3 = Color3.new(math.random(),math.random(),math.random())
        jump.TextColor3 = Color3.new(math.random(),math.random(),math.random())
        speed.TextColor3 = Color3.new(math.random(),math.random(),math.random())
        teleport.TextColor3 = Color3.new(math.random(),math.random(),math.random())
        xray.TextColor3 = Color3.new(math.random(),math.random(),math.random())
        rainbowmenu.TextColor3 = Color3.new(math.random(),math.random(),math.random())
        noclipT.TextColor3 = Color3.new(math.random(),math.random(),math.random())
        teamT.TextColor3 = Color3.new(math.random(),math.random(),math.random())
        raycastT.TextColor3 = Color3.new(math.random(),math.random(),math.random())
        autoupdateT.TextColor3 = Color3.new(math.random(),math.random(),math.random())
        addespT.TextColor3 = Color3.new(math.random(),math.random(),math.random())

        -------------------------------------------------------------------------------
        espt.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
        godmode.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
        jump.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
        speed.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
        teleport.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
        rainbowmenu.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
        xray.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
        noclipT.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
        teamT.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
        raycastT.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
        autoupdateT.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
        addespT.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random())
	end
end)

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