Absolutely nothing happens. The number value does not change, which is the first part.
p = script.Parent n = script.Parent.Number gr = workspace.GreyRim u1 = workspace.Union1 u2 = workspace.Union2 script.Parent.Touched(function() if n.Value == 1 then script.Parent.Script.Disabled = true n.Value = 0 script.Parent.BrickColor = BrickColor.new("Bright blue") for index,v in pairs(workspace.Glass:GetChildren()) do for i = 1,8 do v.Transparency = .7 v.CanCollide = true end end for i = 1,160 do p.CFrame = p.CFrame * CFrame.new(0,.135,0) gr.CFrame = gr.CFrame * CFrame.new(0,.135,0) u1.CFrame = u1.CFrame * CFrame.new(0,.135,0) u2.CFrame = u2.CFrame * CFrame.new(0,.135,0) wait(.05) end wait(1) p.BrickColor = BrickColor.new("Medium blue") n.Value = 1 for index,v in pairs(workspace.Glass:GetChildren()) do for i = 1,8 do v.Transparency = 1 v.CanCollide = false end end wait(5) script.Parent.Script.Disabled = true end if n.Value == 0 then script.Parent.Script.Disabled = true n.Value = 1 script.Parent.BrickColor = BrickColor.new("Bright blue") for index,v in pairs(workspace.Glass:GetChildren()) do for i = 1,8 do v.Transparency = .7 v.CanCollide = true end end for i = 1,160 do p.CFrame = p.CFrame * CFrame.new(0,-.135,0) gr.CFrame = gr.CFrame * CFrame.new(0,-.135,0) u1.CFrame = u1.CFrame * CFrame.new(0,-.135,0) u2.CFrame = u2.CFrame * CFrame.new(0,-.135,0) wait(.05) end wait(1) p.BrickColor = BrickColor.new("Medium blue") n.Value = 1 for index,v in pairs(workspace.Glass:GetChildren()) do for i = 1,8 do v.Transparency = 1 v.CanCollide = false end end wait(5) script.Parent.Script.Disabled = true end end)
Whoops, sorry about the comment above. I noticed what the problem was right after I posted that. You didn't connect the function to the event. Try this:
p = script.Parent n = script.Parent.Number gr = workspace.GreyRim u1 = workspace.Union1 u2 = workspace.Union2 script.Parent.Touched:connect(function() --You just needed to add a ":connect" here. if n.Value == 1 then script.Parent.Script.Disabled = true n.Value = 0 script.Parent.BrickColor = BrickColor.new("Bright blue") for index,v in pairs(workspace.Glass:GetChildren()) do for i = 1,8 do v.Transparency = .7 v.CanCollide = true end end for i = 1,160 do p.CFrame = p.CFrame * CFrame.new(0,.135,0) gr.CFrame = gr.CFrame * CFrame.new(0,.135,0) u1.CFrame = u1.CFrame * CFrame.new(0,.135,0) u2.CFrame = u2.CFrame * CFrame.new(0,.135,0) wait(.05) end wait(1) p.BrickColor = BrickColor.new("Medium blue") n.Value = 1 for index,v in pairs(workspace.Glass:GetChildren()) do for i = 1,8 do v.Transparency = 1 v.CanCollide = false end end wait(5) script.Parent.Script.Disabled = true end if n.Value == 0 then script.Parent.Script.Disabled = true n.Value = 1 script.Parent.BrickColor = BrickColor.new("Bright blue") for index,v in pairs(workspace.Glass:GetChildren()) do for i = 1,8 do v.Transparency = .7 v.CanCollide = true end end for i = 1,160 do p.CFrame = p.CFrame * CFrame.new(0,-.135,0) gr.CFrame = gr.CFrame * CFrame.new(0,-.135,0) u1.CFrame = u1.CFrame * CFrame.new(0,-.135,0) u2.CFrame = u2.CFrame * CFrame.new(0,-.135,0) wait(.05) end wait(1) p.BrickColor = BrickColor.new("Medium blue") n.Value = 1 for index,v in pairs(workspace.Glass:GetChildren()) do for i = 1,8 do v.Transparency = 1 v.CanCollide = false end end wait(5) script.Parent.Script.Disabled = true end end)
Try it now. I think that this should work. If not, please leave a comment below, and I'll see what I can do to fix it. Hope I helped :P