-
What I want to achieve is unpausing a animation when they quickly tap the key that plays the animation
-
The Issue is it won’t unpause when I quickly tap the key which is what I want to work
-
I tried looking around the devfourm but it seems noone either talked about it or I couldn’t find a solution
local UIS = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local char = player.CharacterAdded:Wait() or player.Character
local humanoid = char:WaitForChild("Humanoid")
local FinalFlashAnim = Instance.new("Animation")
FinalFlashAnim.AnimationId = game.ReplicatedStorage.FinalFlash.AnimationId
local FinalFlash = humanoid.Animator:LoadAnimation(FinalFlashAnim)
local IsHeld = false
UIS.InputBegan:Connect(function(input, typing)
if typing then return end
if input.KeyCode == Enum.KeyCode.E then
IsHeld = true
if IsHeld == true then
FinalFlash:Play()
FinalFlash:GetMarkerReachedSignal("Held"):Connect(function()
FinalFlash:AdjustSpeed(0)
end)
game.ReplicatedStorage.RemoteEvent:FireServer()
end
end
end)
UIS.InputEnded:Connect(function(input, typing)
if typing then return end
if input.KeyCode == Enum.KeyCode.E then
IsHeld = false
if IsHeld == false then
FinalFlash:AdjustSpeed(1)
print("Not Held")
end
end
end)