How can i make a button that makes the player attack once

i want to make a way for the player to attack by pressing a button such as “Q” and it would make the player slash a sword that would damage other humanoids but it wouldnt apear in there inventory only when they slash how would i do that

Make sure to edit the original topic with the code that you have already written so that we can help you.

you would detect the key you want to attack with via userinputservice and then clone a weapon, set its position, and weld it to the players hand. Then play the animation for the slash and add a hitbox in front of the player that detects and damages other humanoids using the touched event or raycast result or whatever your hitbox system uses. Finally, you would delete the weapon and the hitbox after your character is done with the move

1 Like