What the title says. I can do the animation part, just don't know how to detect when the player presses a key. (Without having a tool equipped)
You should use userinputservice (as keydown is ripped)
Like this
local UserInputService = game:GetService('UserInputService') function onInputBegan(input,gameProcessed) -- Code end UserInputService.InputBegan:connect(onInputBegan)
Userinputservice has inputbegan and inputended wich both equal to keydown and keyup.
If you have any more questions, just ask :)
theUserInputService = game:GetService("UserInputService") -- this is what it is
theUserInputService.InputBegan:Connect(function(key, processedevent) -- this is the key-bind
if processedevent then return end -- this is so animations don't play while you are typing
if key.KeyCode == Enum.KeyCode.Z then -- this is the key you would press, change Z to yours.
(animation stuff go here)
end
end)