When activating a tool it decreases flashes by 1 and prints it (this worked alone) but when I added the part for changing the brickcolor the script broke and stopped doing anything. It should change the color of the part based on how much flashes you have left. This is my code (in a local script)
local flashes = 2
local chargepart = script.Parent:FindFirstChild("Charge")
tool.Activated:Connect(function()
flashes -= 1
print(flashes)
end)
coroutine.wrap(function()
while true do
if flashes == 2 then
chargepart.BrickColor = BrickColor.new("Lime green")
elseif flashes == 1 then
chargepart.BrickColor = BrickColor.new("New Yeller")
elseif flashes == 0 then
chargepart.BrickColor = BrickColor.new("Really red")
end
end
end)

** You are now Level 1! **