this is my basic script structure
local Module = {} function Module.Function() local function LocalFunction() while true do wait(.1) if value is true then print("exp") -- this will print meaning the if condition was met but break -- this don't break end print("loop still running") -- this keeps printing after it should have broke end end LocalFunction() end return Module
Dude, it goes on forever because "while TRUEEEEEE do". Just put a boolean variable replacing true.
Huntergamind is 100% wrong, since you put "if value is<<(This does not exist) true then". It caused an error
It's "if value == true then"
while true do if value == true then print("exp") break end end
Normally when using while loops I don't use breaks to stop them. I would use a variable in place of "true." Looking something like this(just copying your code and changing it)...
local Module = {} function Module.Function() --removed the local function because you did not need it for what you had going while variable == false do--will run this loop until the variable is set to true --run code wait(.1) end end return Module
As with your code, I am not sure what "value is" is referencing. When making variables they need to be one word. The break is never run in your code because the value is never set to true.