local enabled = true
Player = script.Parent.Parent
--Player:WaitForDataReady()
mouse = Player:GetMouse()
run = game:GetService("RunService")
function onKeyDown(key)
if not enabled then return end
enabled = false
key = key:lower()
if key == "z" then
local animation = Instance.new("Animation")
animation.AnimationId = "b126ab943d35e9b7e3bb92379d9504d7"
local animTrack = humanoid:LoadAnimation(animation)
animTrack:Play()
end
end
enabled = true
mouse.KeyDown:connect(onKeyDown)
Im not sure if the animation is stopping it from working or if it is the OnKeyDown, please help.

6 comments
Is the script local?
No.
Is it meant to be?
Not exactly, but's it's recommended. It's easier to find the player in a local script using LocalPlayer.
Also, to get the animation, press export in the animation editor. It will cost you some robux though.
How would I get the asset ID?