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

Trying to make doors open but nothing happens?

Asked by 4 years ago
01-- Variables
02local LeftDoor = workspace.Ticket_Scanner.Left_Door
03local RightDoor = workspace.Ticket_Scanner.Right_Door
04local LeftOpen = workspace.Ticket_Scanner.Left_Door_Open
05local RightOpen = workspace.Ticket_Scanner.Right_Door_Open
06local Scanner = workspace.Ticket_Scanner.Scanner.Scanner_Display
07local Assest = 5976807639
08local Ready = 5976807535
09 
10 
11 
12 
13workspace.Ticket_Scanner.Scanning_Area.Touched:Connect(function(hit)
14    if hit.Scanning_Area.Name == "TicketPlaceHolder" then
15        LeftDoor.Transparency = 1
View all 28 lines...

^^ My code.

I am trying to make a Ticket Scanner, with opening doors (not with Tween or CFrame, just 2 parts) and it is not working. No errors whatsoever.

2 answers

Log in to vote
1
Answered by
Axmos 25
4 years ago

It's probably due to the fact you don't have any other if statements to justify/compliment the first one, for example:

01if hit.Scanning_Area.Name == "TicketPlaceHolder" then
02        LeftDoor.Transparency = 1
03        RightDoor.Transparency = 1
04        RightOpen.Transparency = 0.3
05        LeftOpen.Transparency = 0.3
06        Instance.new("Decal", Scanner)
07        Scanner.Decal.Texture = Assest
08        wait(2.5)
09        Scanner.Decal.Texture = Ready
10        LeftDoor.Transparency = 0.3
11        RightDoor.Transparency = 0.3
12        RightOpen.Transparency = 1
13        LeftOpen.Transparency = 1
14elseif
15    hit.Scanning_Area.Name ~= "TicketPlaceHolder" then
16    -- Do whatever you want.
17end

Hope this helps!

Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

From what I understand you're making a door where you make the closed position invisible and make the open one visible. You're forgetting to set CanCollide = false on the closed position doors since you don't move them away.

01-- Variables
02local LeftDoor = workspace.Ticket_Scanner.Left_Door
03local RightDoor = workspace.Ticket_Scanner.Right_Door
04local LeftOpen = workspace.Ticket_Scanner.Left_Door_Open
05local RightOpen = workspace.Ticket_Scanner.Right_Door_Open
06local Scanner = workspace.Ticket_Scanner.Scanner.Scanner_Display
07local Assest = 5976807639
08local Ready = 5976807535
09 
10 
11 
12 
13workspace.Ticket_Scanner.Scanning_Area.Touched:Connect(function(hit)
14    if hit.Scanning_Area.Name == "TicketPlaceHolder" then
15        LeftDoor.Transparency = 1
View all 34 lines...

Hope this code works for what you're making.

Answer this question