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

Open door button script not working. Any help? (This button is for a rank+ only.)

Asked by
ghxstlvty 133
5 years ago
Edited 5 years ago
01local ClickDetector = script.Parent.ClickDetector
02open = false
03LGate2 = script.Parent.LGate2
04RGate2 = script.Parent.RGate2
05Increment = 180
06 
07ClickDetector.MouseClick:Connect(function (player)
08    if player:GetRankInGroup(4853203) >= 10 then
09        script.Parent.ClickDetector.MouseClick:Connect(function()
10    if open == false then
11        open = true
12        for C = 1, Increment do
13            wait()                             
14            LGate2.PrimaryPart = LGate2.hinge
15            RGate2.PrimaryPart = RGate2.hinge                          
View all 31 lines...

My script to open a door isn't working. This is where everything is located: https://prnt.sc/r9rgvp

There are two doors with 1 script each. I have a left and a right door.

2 answers

Log in to vote
0
Answered by 5 years ago

Problems

On line 3 and 4 you said script.Parent.LGate2 and script.Parent.RGate2 and script.Parent is RemotePadInterview and RemotePadTraining

Solution

Replace script.Parent with script.Parent.Parent

Final Script Snippet

1local ClickDetector = script.Parent.ClickDetector
2open = false
3LGate2 = script.Parent.Parent.LGate2
4RGate2 = script.Parent.Parent.RGate2
5Increment = 180
6 
7-- Other code here...
0
Thanks so much! I did this to both scripts but... the interview door isn't working. ghxstlvty 133 — 5y
0
Nevermind, you just have to double click the button and it opens. Thanks for the help! ghxstlvty 133 — 5y
0
No Problem :D Luka_Gaming07 534 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

I think that line 9 is stoping it from working. Remove line 9 and the end for it and try again

0
It's saying something about line 3. I did just delete line 9 though. ghxstlvty 133 — 5y

Answer this question