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

How to break a while loop with signal from a bindable event?

Asked by 2 years ago
Edited 2 years ago

local counter = 0 local function test(toBreak) While true do If toBreak == false then break end

counter = counter + 1 If counter >= 1 then break

Wait(1) end end BindableEvent. Event:Connect(test) ………………………………………….. counter changing to 1 will break the while loop. Sending toBreak = false via event will not . Does anyone understand why and how to fix this? Thank you .

Answer this question