I’m trying to play an animation when you click a button but it gives me the error " Cannot load the AnimationClipProvider Service." (Line 7) after I reset or my character dies. This is on a local script And I can’t find a good solution. Any help is appreciated.
Dummy = game.Players.LocalPlayer.Character
local Emotes = game.Workspace.GlobalVariables.Emotes
game.ReplicatedStorage.PlayEmote.OnClientEvent:Connect(function()
if game.Workspace.GlobalVariables.Emotes.a6.Enabled == true then
local animation = Dummy.Script:WaitForChild('Animation6')
local humanoid = Dummy:WaitForChild('Humanoid')
local animation = humanoid:LoadAnimation(animation)
local animation2 = Dummy:WaitForChild("Animate").idle.Animation1
local humanoid2 = Dummy:WaitForChild('Humanoid')
local animation2 = humanoid:LoadAnimation(animation2)
animation.Looped = false
for i,v in pairs(Dummy:WaitForChild("Humanoid"):GetPlayingAnimationTracks()) do
v:Stop()
animation:play()
wait(0.2)
Dummy.slam:play()
animation.Stopped:wait()
animation2:play()
animation.Looped = false
end
end
end)
script.Parent.MouseButton1Click:Connect(function()
Emotes:FindFirstChild("a6").Enabled = true
for i, EmoteObj in pairs(Emotes:GetChildren()) do
if EmoteObj.Name ~= "a6" then
EmoteObj.Enabled = false
end
end
end)