Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Trying to change brick color, gives an error. What am i doing wrong? [answered]

Asked by 3 years ago
Edited 3 years ago

Well, I'm trying to make a laser gate that opens and closes, and I keep getting this error trying to change the color. I don't know what I'm doing wrong, and I tried = brickcolor."" but it doesnt work either, just gives me an error. What do i do? did i do something wrong? the print works by the way.

game.Workspace.ButtonCO.OnServerEvent:Connect(function()
    if game.Workspace.Lasers.Laserr.BrickColor == '255,84,84' then
        print("yes")
        game.Workspace.Lasers.Laserr.BrickColor = BrickColor "25,255,25"
        game.Workspace.Lasers.Laserr.CanCollide = false
    else
        print("no")
        game.Workspace.Lasers.Laserr.BrickColor = BrickColor "255,84,84"
        game.Workspace.Lasers.Laserr.CanCollide = true
    end
end)
0
you're using strings AAzterr 27 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago

The way you are changing the BrickColor is wrong, and you do it this way:

game.Workspace.Lasers.Laserr.BrickColor = BrickColor.new(25,255,25)

~ Dan_PanMan, Advanced Scripter.

Ad

Answer this question