I want to make it so that when the button or B1 is Red it cannot be clicked but when it is Lime Green it can be clicked.
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
walk.Transparency = 1
walk2.Transparency = 1
print 'off'
wait(5)
print 'on'
walk.Transparency = 0
walk2.Transparency = 0
walk2.CanCollide = true
walk.CanCollide = true
wait(5)
B1.BrickColor = BrickColor.new('Lime green')
end
B1.ClickDetector.MouseClick:connect(onClick)

3 comments
I was thinking of this but concidering this has to be a model for someone's place I could not use server storage for this. Thank you though!
If ServerStorage does not satisfy your needs, you can replace the path to... Let's say game.Lighting perhaps that would be a solution
Possibly though as I said before I would need to tell the owner of the place I am making the model for that they would need to put something in lighting. Maybe creating a folder in the model in which click detector is located to be cloned may work?