I did this but the transition is not so smooth. Is there any way to make a simpler and better script like this? Please help, thank you! <3
local anim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Anim) local animPause = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.AnimPause) script.Parent.Equipped:Connect(function(mouse) mouse.Button1Down:Connect(function() anim:Play() wait(anim.Length) anim:Stop() animPause:Play() end) end)
I think you would need to make a continuing animation after that. You also need to destroy the playing animation when stopping. Code:
local anim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Anim) local animPause = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.AnimPause) local animResumeAnim = Instance.new("Animation") animResumeAnim.Parent = script animResumeAnim.Name = "AnimResume" local animResume = game.Players.LocalPlayer.Humanoid:LoadAnimation(animResumeAnim) script.Parent.Equipped:Connect(function(mouse) mouse.Button1Down:Connect(function() anim:Play() wait(anim.Length) anim:Stop() anim:Destroy() animPause:Play() end) mouse.Button1Up:Connect(function() animResume:Play() end) end)
If this works, please accept. Otherwise, comment and I will edit my answer.