Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- loadstring([[
- _G.stopAnimation = true
- local Players = game:GetService("Players")
- local UIS = game:GetService("UserInputService")
- local player = Players.LocalPlayer
- if not player or not player.Character then return end
- local humanoid = player.Character:FindFirstChildWhichIsA("Humanoid")
- if not humanoid then return end
- local function isR15()
- return humanoid.RigType == Enum.HumanoidRigType.R15
- end
- local anim = Instance.new("Animation")
- anim.AnimationId = isR15() and "rbxassetid://698251653" or "rbxassetid://72042024"
- local animator = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", humanoid)
- local track = animator:LoadAnimation(anim)
- local function playAnimation()
- while not _G.stopAnimation do
- if track then
- track:Play()
- track:AdjustSpeed(isR15() and 0.7 or 0.65)
- track.TimePosition = 0.6
- while track and track.IsPlaying and track.TimePosition < (isR15() and 0.7 or 0.65) do
- if _G.stopAnimation then return end
- task.wait(0.1)
- end
- track:Stop()
- task.wait(0.01)
- end
- end
- end
- UIS.InputBegan:Connect(function(input, gameProcessed)
- if gameProcessed then return end
- if input.KeyCode == Enum.KeyCode.H then
- _G.stopAnimation = not _G.stopAnimation
- if not _G.stopAnimation then
- playAnimation()
- else
- if track then
- track:Stop()
- end
- end
- end
- end)
- ]])()
Advertisement
Add Comment
Please, Sign In to add comment