local onColor = Color3.fromRGB(0, 255, 0)
local offColor = Color3.fromRGB(255, 0, 0)
switchStair.Color = offColor
local stair1 = game.Workspace.Stair.Stair1
local stair2 = game.Workspace.Stair.Stair2
local stair3 = game.Workspace.Stair.Stair3
local stair4 = game.Workspace.Stair.Stair4
local stair5 = game.Workspace.Stair.Stair5
local stair6 = game.Workspace.Stair.Stair6
local stair7 = game.Workspace.Stair.Stair7
local stairArray = {stair1, stair2, stair3, stair4, stair5, stair6, stair7}
local function showStair()
for i=1, #stairArray do
switchStair.Color = onColor
stairArray[i].Color = onColor
stairArray[i].CanCollide = true
stairArray[i].Transparency = 0
wait(1)
end
wait(3)
for i=#stairArray, 1, -1 do
stairArray[i].Color = offColor
stairArray[i].CanCollide = false
stairArray[i].Transparency = 0.8
wait(2)
end
switchStair.Color = offColor
end
for i=1, #stairArray do
stairArray[i].Color = offColor
end
local switchStair = script.Parent
local onColor = Color3.fromRGB(0, 255, 0) local offColor = Color3.fromRGB(255, 0, 0)
switchStair.Color = offColor
local stair1 = game.Workspace.Stair.Stair1 local stair2 = game.Workspace.Stair.Stair2 local stair3 = game.Workspace.Stair.Stair3 local stair4 = game.Workspace.Stair.Stair4 local stair5 = game.Workspace.Stair.Stair5 local stair6 = game.Workspace.Stair.Stair6 local stair7 = game.Workspace.Stair.Stair7
local stairArray = {stair1, stair2, stair3, stair4, stair5, stair6, stair7}
local function showStair() for i=1, #stairArray do switchStair.Color = onColor stairArray[i].Color = onColor stairArray[i].CanCollide = true stairArray[i].Transparency = 0 wait(1) end
end
for i=1, #stairArray do stairArray[i].Color = offColor end
switchStair.Touched:Connect(showStair)