If someone could tell me what I did wrong with the code below, I would appreciate it.
local leftDoor = script.Parent.LeftDoor:GetChildren()[1]
leftDoor.PrimaryPart.Anchored = true
local rightDoor = script.Parent.RightDoor:GetChildren()[1]
rightDoor.PrimaryPart.Anchored = true
local humanoidLeft = leftDoor:FindFirstChildOfClass("Humanoid")
local humanoidRight = rightDoor:FindFirstChildOfClass("Humanoid")
humanoidLeft:Destroy()
humanoidRight:Destroy()
local animationControllerLeft = Instance.new("AnimationController", leftDoor)
local animationControllerRight = Instance.new("AnimationController", rightDoor)
local animationLeft = Instance.new("Animation", leftDoor)
local animationRight = Instance.new("Animation", rightDoor)
animationLeft.AnimationId = "http://www.roblox.com/asset/?id=2961216872"
animationRight.AnimationId = "http://www.roblox.com/asset/?id=2961217745"
local animationTrackLeft = animationControllerLeft:LoadAnimation(animationLeft)
local animationTrackRight = animationControllerRight:LoadAnimation(animationRight)
if script.Parent.MotionDetector1.IsDetected.Value == true or script.Parent.MotionDetector2.IsDetected.Value == true then
animationTrackLeft:Play()
animationTrackRight:Play()
end

1 comment
Holy mother of unreadable code. Please indent your code.