I'm just trying to get a rainbow effect and toggling it using v variable wont even disable it. After v == true it is looped forever. How can I fix this? I even searched the web and It still does not help, putting disconnect in the connection loop.
01 | local v = = true |
02 |
03 | if v = = true then |
04 | local c |
05 | c = game:GetService( "RunService" ).RenderStepped:Connect( function () |
06 | Part.Color = Color 3. fromHSV(tick() % 25 / 25 , 1 , 1 ) |
07 | if v = = false then |
08 | c:Disconnect() |
09 | end |
10 | end ) |
11 | end |
I found the solution. The variable inside the function inside the function can't be changed to disconnect. Instead I put the v outside the function