Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

1 comment

0

you're using strings

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.