Script for changing colors and materials doesn't work

I’m making a jeopardy game, and this script turns makes the walls and logo smoothplastic, then makes the walls red. After 30 seconds, it should make the walls blue, and the walls and logo neon. However, nothing happens when I press the button. This is a serverscript inside the button meant to activate it.

script.Parent.MouseButton1Click:Connect(function()
game.Workspace.walls.Union.Material = Enum.Material.SmoothPlastic
game.Workspace.walls.Union.BrickColor = BrickColor.new(255,0,0)
game.Workspace.logo.Union.Material = Enum.Material.SmoothPlastic
wait(30)
game.Workspace.walls.Union.Material = Enum.Material.Neon
game.Workspace.walls.Union.BrickColor = BrickColor.new(51,77,220)
game.Workspace.logo.Union.Material = Enum.Material.Neon
end

Possibly attempt changing “BrickColor” to “Color3”

1 Like

Try this:

script.Parent.MouseButton1Click:Connect(function()
game.Workspace.walls.Union.Material = “SmoothPlastic”
game.Workspace.walls.Union.BrickColor = Color3.new(255,0,0)
game.Workspace.logo.Union.Material = “SmoothPlastic”
wait(30)
game.Workspace.walls.Union.Material = “Neon”
game.Workspace.walls.Union.BrickColor = Color3.new(51,77,220)
game.Workspace.logo.Union.Material = “Neon”
end

So, Color3.new(255,0,0)?
30chars

game.Workspace.walls.Union.Color = Color3.new(255,0,0)

Does this have anything to do with it?
image

That happens when you hit shift-enter, you can just select all the code, Ctrl-X it and Ctrl-V it back and it gets fixed.

1 Like

Unfortunately, none of these solutions worked, even though I used the control x to remove the unicode character error.

255, 0, 0 is meant for “Really red”, correct?

What does your code look like right now?

You could possibly try:

BrickColor = BrickColor.new(‘Really red’)

game.Workspace.walls.Union.Material = ""SmoothPlastic""
game.Workspace.walls.Union.BrickColor = Color3.new(255,0,0)
game.Workspace.logo.Union.Material = "SmoothPlastic"
wait(30)
game.Workspace.walls.Union.Material = "Neon"
game.Workspace.walls.Union.BrickColor = Color3.new(51,77,220)
game.Workspace.logo.Union.Material = "Neon"
end```

There’s your error. Change the quotes to " instead of “”. And the BrickColor to Color as @Salutiants said.

1 Like

Oh, change the “BrickColor” to “Color”

game.Workspace.walls.Union.Color = Color3.new(255,0,0)
game.Workspace.walls.Union.Color = Color3.new(51,77,220)

How do I change the quotes? There’s just one " button on my keyboard.

You simply don’t press it twice.
“” = two " quotes
" = one " quote

I’m surprised nobody has realized this. It’s supposed to be Color3.fromRGB().

2 Likes
game.Workspace.walls.Union.Material = "SmoothPlastic"
game.Workspace.walls.Union.Color = Color3.new(255,0,0)
game.Workspace.logo.Union.Material = "SmoothPlastic"
wait(30)
game.Workspace.walls.Union.Material = "Neon"
game.Workspace.walls.Union.Color = Color3.new(51,77,220)
game.Workspace.logo.Union.Material = "Neon"
end

still doesn’t work

What part of it doesn’t work? 30 chars

Nothing happens when I click the button.