Hey!
I'm fairly new to scripting and I'm having trouble how to figure out how to loop some code until a condition is met or repeat some code until a condition is met.
(any help would be greatly appreciated)
Here is my current script:
local value = game.Workspace.Value if value.Value > 20 then while true do wait(0.01) script.Parent.Material = Enum.Material.Neon wait(0.7) script.Parent.Material = Enum.Material.SmoothPlastic wait(0.7) end if value.Value > 20 then break end
do repeat
local value = game.Workspace.Value if value.Value > 20 then repeat wait(0.01) script.Parent.Material = Enum.Material.Neon wait(0.7) script.Parent.Material = Enum.Material.SmoothPlastic wait(0.7) value.Value = value.Value + 1 until value.Value > 30 end
This repeats it 10 times, cause 20 + 1 + 1 + 1 etc will eventually become 30