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.
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)
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)
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?