local brick = workspace.brick function loopityLoop() while brick.BrickColor = BrickColor.Red() do -- The loop that will run until "brick.BrickColor" isn't red anymore! (Also "BrickColor.Red()" is the bright red color!) game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key) if string.lower(key) == "q" then local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID=144884906" local animTrack = Humanoid:LoadAnimation(animation) animTrack:Play() end end) wait() -- Used so studio nor Roblox will crash! end end brick.Changed:connect(loopityLoop) game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key) if string.lower(key) == "q" then brick.BrickColor = BrickColor.Red() local b2 = workspace.b2 b2 BrickColor = BrickColor.White()
Please help edit
I detected two errors on your script.
You are doing an error on the line 4:
Example:
while money = 5 do
You are assigning a value. As TheAlphaStigma
said, =
writes a variable, ==
compares it with another value
If your script isn't idented correctly, it will be harder for we to answer your question.
So, the full script:
local brick = workspace.brick function loopityLoop() while brick.BrickColor == BrickColor.Red() do -- The loop that will run until "brick.BrickColor" isn't red anymore! (Also "BrickColor.Red()" is the bright red color!) game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key) if string.lower(key) == "q" then local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID=144884906" local animTrack = Humanoid:LoadAnimation(animation) animTrack:Play() end end) wait() -- Used so studio nor Roblox will crash! end end brick.Changed:connect(loopityLoop) game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key) if string.lower(key) == "q" then brick.BrickColor = BrickColor.Red() local b2 = workspace.b2 b2 BrickColor = BrickColor.White() end end)