SetColor() not changing after first use

This is the code which should be working.

[lua]timer.Simple(10, function()
if IsValid(self) then
Level = 2
self:SetColor(255,0,0,255)
end
end)
timer.Simple(20, function()
if IsValid(self) then
Level = 3
self:SetColor(0,255,0,255)
end
end)
timer.Simple(30, function()
if IsValid(self) then
Level = 4
self:SetColor(0,0,255,255)
end
end)
timer.Simple(40, function()
if IsValid(self) then
Level = 5
self:SetColor(0,0,0,255)
end
end)
end
[/lua]

Currently it spawns, changes colour after 10 seconds, but then does not change again on the next function. Originally I thought it was that the function wasn’t being called so I added a check to print every time it changed, which is did. So I know the function is being called, it is just that the color is not being changed on the second timer. Any help?

SetColor takes a table, not 4 numbers.

SetColor(Color(255, 0, 0, 255))

for example.

Thank you very much! :slight_smile: