All the doors are in the same folder. All the doors have the same name, and part class. Why is this only turning some doors transparency?
Code:
local C = false
local doors = game.Workspace.Doors
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(Input, gameProcessedEvent)
if gameProcessedEvent == false and Input.KeyCode == Enum.KeyCode.X then
for i,v in pairs(doors:GetDescendants()) do
if v:IsA("BasePart") then
if v.Name == "Door" then
if C == false then
v.Transparency = .5
v.CanCollide = false
C = true
elseif C == true then
v.Transparency = 0
v.CanCollide = true
C = false
end
end
end
end
end
end)

2 comments
put line 1 after line 7
Is every part of your doors Named Exactly "Door"?