Hello everyone, I'm trying to make it so that my script doesn't run all at once and wait() is not what I want. When I click, all of the script starts, is there any way to stop it once the variable toggle has changed?
local button = script.Parent
local function click()
local toggle = 1
if toggle == 1 then
button.Font = Enum.Font.Arcade
toggle = 2
end
if toggle == 2 then
button.Font = Enum.Font.Highway
toggle = 3
end
if toggle == 3 then
button.Font = Enum.Font.Fantasy
toggle = 4
end
if toggle == 4 then
button.Font = Enum.Font.GothamBold
toggle = 5
end
if toggle == 5 then
button.Font = Enum.Font.SourceSans
toggle = 1
end
end
button.MouseButton1Down:Connect(click)
Thanks, any help would be appreciated

2 comments
Please remember to accept my answer if you find it useful.
Wait guys, sorry, I'm just stupid, I could've just used elseif, sorry.