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)
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
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!