if i == 20 then for i,v in pairs(players) do coroutine.wrap(function() v:WaitForChild("PlayerGui") p = 5 for z = 1,130 do v.PlayerGui.title.TextLabel.BackgroundColor3 = Color3.new(255,z,0) wait(.1) end end)() end end wait(p) if i == 20 then for i,v in pairs(players) do coroutine.wrap(function() v:WaitForChild("PlayerGui") p = 5 for z = 1,130 do q = 130 - z v.PlayerGui.title.TextLabel.BackgroundColor3 = Color3.new(255,q,0) wait(.1) end end)() end table.insert(Cops,players[playerShown]) removeTable(players,players[playerShown]) end
having some issues with this code, I want the GUI to turn red>orange slowly then 5 seconds later orange>red slowly but the GUI goes from red to yellow INSTANTLY then 10 seconds later goes from yellow to red INSTANTLY
any errors you can see? output is clean
what am I doing wrong?
This is the fix, visually, for those who want to see it:
if i == 20 then for i, v in pairs(players) do coroutine.wrap(function() v:WaitForChild("PlayerGui") p = 5 for z = 1,130 do v.PlayerGui.title.TextLabel.BackgroundColor3 = Color3.new(1, z / 255, 0) wait(0.1) end end)() end end wait(p) if i == 20 then for i, v in pairs(players) do coroutine.wrap(function() v:WaitForChild("PlayerGui") p = 5 for z = 1,130 do q = 130 - z v.PlayerGui.title.TextLabel.BackgroundColor3 = Color3.new(1, q / 255, 0) wait(0.1) end end)() end table.insert(Cops,players[playerShown]) removeTable(players,players[playerShown]) end