Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does the script only work once?

Asked by 9 years ago
01script.Parent.ClickDetector.MouseClick:connect(function()
02    if game.Workspace.Blind1.Transparency == 0
03        then game.Workspace.Blind1.Transparency = 1
04        game.Workspace.Blind2.Transparency = 1
05        game.Workspace.Blind3.Transparency = 1
06        game.Workspace.Blind4.Transparency = 1
07        game.Workspace.Blind5.Transparency = 1
08        game.Workspace.Blind6.Transparency = 1 
09        game.Workspace.Blind7.Transparency = 1 
10        game.Workspace.Blind8.Transparency = 1
11        game.Workspace.Blind9.Transparency = 1
12        game.Workspace.Blind10.Transparency = 1
13        game.Workspace.Blind11.Transparency = 1
14        game.Workspace.Blind12.Transparency = 1
15        game.Workspace.Blind13.Transparency = 1
View all 38 lines...

That's the script for a window script with blinds. The problem is that in studio (Haven't tried in online mode because its not an active place.) the script will work once. I can click it once to open it, once to close it, and then after that it doesn't work anymore. The output says nothing and i don't know what the problem is.

1 answer

Log in to vote
0
Answered by 9 years ago
1script.Parent.ClickDetector.MouseClick:connect(function()
2    if game.Workspace.Blind1.Transparency == 0
3        then game.Workspace.Blind1.Transparency = 1

You forgot to change the Blind1's Transparency back to 0 once closed.

0
Oh, thanks. I'm an idiot like that sometimes. clalexander 40 — 9y
Ad

Answer this question