Problems changing animation speed

Basically, the pausing part of the script only works for the first use of the tool. If you use it more than once, it doesn’t pause the animation at all.

local tool = script.Parent
local debounce = false
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()

repeat wait() until Character:FindFirstChild("Humanoid")

local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://5237692109"

tool.Activated:Connect(function()
	if debounce == false then
		debounce = true
		local animationTrack = Character.Humanoid:LoadAnimation(Animation)
		animationTrack:Play()
		wait(2/3)
		animationTrack:AdjustSpeed(0)
		ReplicatedStorage.Remotes.ShinsuBlast:FireServer()
		wait(1)
		animationTrack:AdjustSpeed(1)
		wait(2)
		debounce = false
	end
end)

No errors or anything, it just simply doesn’t pause it after the first use.

You could completely avoid using AdjustSpeed and doing this instead. It does the same thing.

local tool = script.Parent
local debounce = false
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()

repeat wait() until Character:FindFirstChild("Humanoid")

local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://5237692109"

tool.Activated:Connect(function()
	if debounce == false then
		debounce = true
		local animationTrack = Character.Humanoid:LoadAnimation(Animation)
		wait(2/3)
		ReplicatedStorage.Remotes.ShinsuBlast:FireServer()
		wait(1)
		animationTrack:Play()
		wait(2)
		debounce = false
	end
end)

Thing is, my animation raises both of the player’s arms, and I paused it right at the end after the arms are raised. Your script would play the animation after the Blast remote has been fired, and therefore the ability would begin before the player’s arms are raised.

I just tested your script and it worked perfectly fine for me. Maybe other scripts in your game are interfering?

Nope, just opened up a fresh game, made it R6, put the tool in, no other scripts. Same thing.

Here’s a gif: https://gyazo.com/c726d862378577a58008caabd3bf1a7e

Can you run this and tell me the output?

local tool = script.Parent
local debounce = false
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()

repeat wait() until Character:FindFirstChild("Humanoid")

local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://5237692109"

tool.Activated:Connect(function()
	if debounce == false then
		debounce = true
		local animationTrack = Character.Humanoid:LoadAnimation(Animation)
		animationTrack:Play()
		wait(2/3)
		animationTrack:AdjustSpeed(0)
		print(animationTrack.Speed)
		ReplicatedStorage.Remotes.ShinsuBlast:FireServer()
		wait(1)
		animationTrack:AdjustSpeed(1)
		wait(2)
		debounce = false
	end
end)
Output --> 0

Prints 0 both times, even though one stops and the other doesn’t.

Can you try this?

local tool = script.Parent
local debounce = false
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()

repeat wait() until Character:FindFirstChild("Humanoid")

local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://5237692109"

tool.Activated:Connect(function()
	if debounce == false then
		debounce = true
		local animationTrack = Character.Humanoid:LoadAnimation(Animation)
		animationTrack:Play()
		wait(2/3)
		animationTrack:AdjustSpeed(0)
		ReplicatedStorage.Remotes.ShinsuBlast:FireServer()
		wait(1)
		animationTrack:AdjustSpeed(1)
		wait(2)
		animationTrack:Stop()
		debounce = false
	end
end)

Same thing, works the first time, doesn’t work the second time. Could it be a problem with the animation itself?

Yeah, as you said, it may be an issue with the animation. Try remaking it and re-uploading it.

Ok so I remade the animation and just made it 1 frame, which means I don’t have to pause it and that fixed it, but there’s a small problem(?), the first time I use it it’s quite jumpy and instead of going smoothly from default position to the arms raised position, it plays the frame instantly. The next times I use it it’s smooth, do you know why?

Make sure the animation has the Action priority, and nothing less.

Can you show a video? Also, make sure animation priority is set to Action.

It’s set to action, here’s a gif: https://gyazo.com/4ab1be794069769ecbc4645786315bb0

First use jumps to the frame, second one transitions smoothly.

I think it plays the frame instantly at first because it hasn’t loaded in.

Try preloading the animation, it may fix your issue.