My open door animation only plays once even though I call on it more than once. My close door animation plays like its suppose to.
This is the script that activates the animation
local remoteopen = script.Parent.RemoteEventOpen
local doors = game.Workspace.Scripting.Doors:GetChildren()
local remoteclose = script.Parent.RemoteEventClose
remoteopen.OnServerEvent:Connect(function(player, v)
local animation = v.OpenDoor
local dooranimate = v.Humanoid:LoadAnimation(animation)
local slow = v.slow
local open = v.open
if slow.Value == 0 then
slow.Value = 1
v.RightArm1.CanCollide = false
dooranimate:Play()
wait(2)
dooranimate:AdjustSpeed(0)
v.RightArm1.CanCollide = true
slow.Value = 0
open.Value = 1
end
end)
remoteclose.OnServerEvent:Connect(function(player, v)
local slow = v.slow
local open = v.open
local animation2 = v.CloseDoor
local doorcloseanimate = v.Humanoid:LoadAnimation(animation2)
if slow.Value == 0 then
slow.Value = 1
doorcloseanimate:Play()
wait(2)
doorcloseanimate:AdjustSpeed(0)
slow.Value = 0
open.Value = 0
end
end)
This is the script that calls on the remote function
local UserInputService = game:GetService("UserInputService")
local doors = game.Workspace.Scripting.Doors:GetChildren()
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local function onInputBegan(InputObject, gameProcessedEvent)
for i , v in pairs(doors) do
if mouse.Target == nil then
return
else
if mouse.Target.Parent == v then
if math.ceil((v.RightArm1.Position - player.Character.Head.Position).Magnitude) <= 5 then
local open = v.open
local eventopen = v.RemoteEventOpen
local eventclose = v.RemoteEventClose
if InputObject.KeyCode == Enum.KeyCode.E and open.Value == 0 then
eventopen:FireServer(v)
elseif InputObject.KeyCode == Enum.KeyCode.E and open.Value == 1 then
eventclose:FireServer(v)
end
end
end
end
end
end
UserInputService.InputBegan:Connect(onInputBegan)

2 comments
have you tried making it so you can overwrite the animation?
no