So this is a script that every time you press "M" You will get a slash animation from your character. What I would LOVE to know (AND WOULD SAVE MY GAME IDEA :D) Is how I would put a cooldown for it?
---Notes------------------------------- It's a Local Script It's INSIDE a StarterCharacter
function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.M then
local animation = game.Workspace.Slash
local anim = script.Parent.Humanoid:LoadAnimation(animation)
anim:Play()
end end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)

1 comment
btw, the "if input" part is UNDER the Processed Event part. my copy and paste doesnt space it right.