Here’s the snippet from my code:
task.wait(5)
local ScriptingsFolder = workspace:WaitForChild("Scriptings")
local DoorsFolder = ScriptingsFolder:WaitForChild("Doors")
for _, Door in ipairs(DoorsFolder:GetChildren()) do
if Door and Door:IsA("Model") then
local DoorKnob = Door:FindFirstChild("Knob")
if DoorKnob then
local DoorAttachment = DoorKnob:FindFirstChild("Attachment")
if DoorAttachment then
local DoorProximity = DoorAttachment:FindFirstChild("ProximityPrompt")
if DoorProximity then
DoorProximity.Triggered:Connect(function()
DoorProximity.Enabled = false
task.delay(0.75, function()
DoorProximity.ActionText = "Leave"
DoorProximity.Enabled = true
end)
Controls:Disable()
Humanoid.AutoRotate = false
QueueEvent:FireServer(Door)
end)
ControlEvent.OnClientEvent:Connect(function(Action, Angle)
if Action == "Unlock" then
DoorProximity.Enabled = false
task.delay(0.75, function()
DoorProximity.Enabled = true
DoorProximity.ActionText = "Queue"
end)
Controls:Enable()
Humanoid.AutoRotate = true
elseif Action == "Lock" and Angle then
local Position = HumanoidRootPart.Position
HumanoidRootPart.CFrame = CFrame.new(Position) * CFrame.Angles(0, math.rad(Angle), 0)
end
end)
else
warn("ProximityPrompt not found in DoorAttachment for door: " .. Door.Name)
end
else
warn("Attachment not found in Knob for door: " .. Door.Name)
end
else
warn("Knob not found directly under door: " .. Door.Name)
end
end
end
I keep getting the warning: Attachment not found in Knob for door: Door1
.
I’m 100% sure that the door structure is correct. I’ve tried everything, including adding a 5-second delay before the script runs, but the issue persists.
Below is an image of the door structure:
And also it’s another local script and not the DoorsHandler script. Any solution?