local brick = game.workspace.brick
local w = game.workspace:WaitForChild("Player")
local h = w.Humanoid
local animation = script.Parent:WaitForChild("Animation")
local anim = h:LoadAnimation("animation")
if brick.BrickColor == BrickColor.Red() then
anim:Play()
end
Output = 20:49:39.672 - Unable to cast value to Object

2 comments
What do you want this to do though?.. :p
There should be a line under the error that tells you where exactly you went wrong.