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.
local v == true if v == true then local c c = game:GetService("RunService").RenderStepped:Connect(function() Part.Color = Color3.fromHSV(tick() % 25 / 25, 1, 1) if v == false then c:Disconnect() end end) 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