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

Sequential opening door not functioning?

Asked by 8 years ago
Edited 8 years ago

This code is designed to open a 50 part door in sequence, change a variable in a folder in Workspace, and then if that variable is "Open", close the door. If it is "Closed" open the door. When I ran it through it doesn't even print anything. I would like some help from the script mastas. It doesn't function, or even print.

Test = game.Workspace.Values.Test.Value
Door = game.Workspace.HoloDoor.DoorVisible
sin = (0)
debounce = false
script.Parent.MouseButton1Down:connect(function()
 if debounce == false then 
debounce = true
wait(sin)
if Test == "Closed" then
    for i = 1,50 do
        local DoorPart = Door["P"..i]
        wait(sin)
        DoorPart.Transparency = 1
        DoorPart.CanCollide = false
game.Workspace.HoloDoor.DoorFrame.Barrier.CanCollide = false
Test = "Open"
print("Open")
end
if Test == "Open" then
    for i = 1,50 do
        local DoorPart = Door["P"..i]
        wait(sin)
        DoorPart.Transparency = 0
        DoorPart.CanCollide = True
game.Workspace.HoloDoor.DoorFrame.Barrier.CanCollide = True
Test = "Closed"
print("Closed")
end
end
 end
end)


2 answers

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

dont know what you're doing wrong it prints for me

Test = game.Workspace.Values.Test.Value
Door = game.Workspace.HoloDoor.DoorVisible
sin = (0)
debounce = false
script.Parent.MouseButton1Down:connect(function()
 if debounce == false then 
debounce = true
wait(sin)
end

if Test == "Closed" then
    for i = 1,50 do
        local DoorPart = Door["P"..i]
        wait(sin)
        DoorPart.Transparency = 1
        DoorPart.CanCollide = false
game.Workspace.HoloDoor.DoorFrame.Barrier.CanCollide = false
Test = "Open"
print("Open")
end
if Test == "Open" then
    for i = 1,50 do
        local DoorPart = Door["P"..i]
        wait(sin)
        DoorPart.Transparency = 0
        DoorPart.CanCollide = true
game.Workspace.HoloDoor.DoorFrame.Barrier.CanCollide = true
Test = "Closed"
print("Closed")
end
end
end
end)
19:24:02.681 - Auto-Saving...
Open
Open
Open
Open
19:24:11.693 - P5 is not a valid member of Part
19:24:11.693 - Script 'Players.Player1.PlayerGui.ScreenGui.Frame.TextButton.Script', Line 13
19:24:11.695 - Stack End
0
Yes SinsofFallenGods 50 — 8y
0
Also next time post a comment not an answer. This aint an answer. SinsofFallenGods 50 — 8y
0
it wouldnt let me post a comment User#12356 0 — 8y
0
i edited this if you didnt give you a notifications User#12356 0 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

wfvj014 helped me fix this. He answered this in the studio chat with me and he is seriously a vast help. Would give him a + rep on here but he wont post that he helped me because he thinks its cheating ;)

Anyway man if you see this thanks, this has been the most help I have had on this site to daye.

+4 to ya man!

Answer this question