local brick = Workspace.brick // I am trying for this to detect a part called "brick" within the workspace.
while true do
wait(0.1)
script.Parent.BrickColor = BrickColor.new("New Yeller")
script.Parent.Reflectance= 0.1
wait(0.1)
script.Parent.Reflectance= 0.2
wait(0.1)
script.Parent.Reflectance= 0.3
wait(0.1)
script.Parent.Reflectance= 0.4
wait(0.1)
script.Parent.Reflectance= 0.5
wait(0.1)
script.Parent.Reflectance= 0.6
wait(0.1)
script.Parent.Reflectance= 0.7
wait(0.1)
script.Parent.Reflectance= 0.8
wait(0.1)
script.Parent.Reflectance= 0.9
wait(0.1)
script.Parent.BrickColor = BrickColor.new("Institutional white")
script.Parent.Reflectance= 1
end
Try something like this?
brick = game.Workspace["Brick"] Reflect = script.Parent.Reflectance Reflect = 0.1 Wait(0.1) while script.Parent.BrickColor = BrickColor.new("New Yeller") do Reflect = (Reflect + 0.1) -- Or you could do Reflect = Reflect + 0.1 if Reflect = 1 then scrip.Parent.BrickColor = BrickColor.new("Institutional white") Wait(0.1) Reflect = (Reflect - 0.9) -- Same with earlier. end
HERE, do this instead.
Reflect = script.Parent.Reflectance Reflect = 0.1 Wait(0.1) while true do script.Parent.BrickColor = BrickColor.new("New Yeller") Reflect = (Reflect + 0.1) -- Or you could do Reflect = Reflect + 0.1 if Reflect == 1 then scrip.Parent.BrickColor = BrickColor.new("Institutional white") Wait(0.1) Reflect = (Reflect - 0.9) -- Same with earlier. end end