Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
Edited 5 years ago

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)
0
You code blocked improperly, try to make sure ALL the code is withing the '~~~~~~~~~~~~' lines alphawolvess 1784 — 5y
0
I don't understand your question, the loop already breaks when your running variable == false. Le_Teapots 913 — 5y
0
oh my bad i put in the wrong thing lol uguns663 0 — 5y
0
So what i mean is how can i toggle this uguns663 0 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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)
Ad

Answer this question