How to implement the opening of doors during animation?

There are doors and there is a zone. When the player is in the zone, also kick animation. I need to make sure that when the player is in range, the doors open.

Animation.

local Character = script.Parent

local Humanoid = Character:FindFirstChild("Humanoid")

--local animationTrack = Humanoid:LoadAnimation(animation)

--animationTrack:Play()

local animation = Instance.new("Animation")

animation.AnimationId = "http://www.roblox.com/asset/?id=12526983237"

local crouchKey = Enum.KeyCode.C

local crouchButton = Enum.KeyCode.ButtonB

local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(key)

if key.KeyCode == Enum.KeyCode.Space then

local animationTrack = Humanoid:LoadAnimation(animation)

animationTrack:Play()

end

end)