The output says something about BrickColor needing to be a string or something. Not really sure what it means.
local B1 = workspace.Deathrun.Button1 local walk = workspace.Deathrun.walk1 local walk2 = workspace.Deathrun.walk2 function onClick() B1.BrickColor = 'Really red' walk2.CanCollide = false walk.CanCollide = false print 'off' wait(10) print 'on' walk2.CanCollide = true walk.CanCollide = true wait(7) B1.BrickColor = 'Lime green' end B1.ClickDetector.MouseClick:connect(onClick)
Although it might look like it, the text you see at the BrickColor properties in Studio are not strings, but BrickColor values. The proper way to create a BrickColor value is through...
BrickColor.new()
This is the function which gives the Parts color. There are 3 (4) types of values that this function accepts, but we'll stick to the string. All you need to do for the string part is to insert the string within the parentheses, like this:
BrickColor.new('Really red')
Therefore, to apply the "Really red" color, you use:
B1.BrickColor = BrickColor.new('Really red')
The exact same method is used for "Lime green". I recommend you take a look at the following Roblox Wiki pages (which will be more useful than what you might think)
More than you ever wanted to know about BrickColor
A full list of available BrickColors (There are more than you can choose in the palette)
local B1 = workspace.Deathrun.Button1 local walk = workspace.Deathrun.walk1 local walk2 = workspace.Deathrun.walk2 function onClick() B1.BrickColor=BrickColor.new'Lime green' walk2.CanCollide = false walk.CanCollide = false print 'off' wait(10) print 'on' walk2.CanCollide = true walk.CanCollide = true wait(7) B1.BrickColor=BrickColor.new'Really red' end --We have a part so we get the new value by equaling it to ".new" B1.ClickDetector.MouseClick:connect(onClick)
If this helped please accept my answer and upvote if possible thanks it's much appreciated.
local B1 = workspace.Deathrun.Button1 local walk = workspace.Deathrun.walk1 local walk2 = workspace.Deathrun.walk2 function onClick() B1.BrickColor = BrickColor.new('Really red') walk2.CanCollide = false walk.CanCollide = false print("Off") wait(10) print ("On") walk2.CanCollide = true walk.CanCollide = true wait(7) B1.BrickColor = BrickColor.new('Lime green') end B1.ClickDetector.MouseClick:connect(onClick)