I want, for example, when the Z button is pressed, the player moves the mouse to a certain place and releases the button, and after the player releases the button, the ability is attacked.
I couldn’t find the answers to this question
Please help
I want, for example, when the Z button is pressed, the player moves the mouse to a certain place and releases the button, and after the player releases the button, the ability is attacked.
I couldn’t find the answers to this question
Please help
The easiest and most preferred way to go about this is using Context action service, where you can bind various functions to the keys of your choice!
For further info, refer the documentation: ContextActionService (roblox.com)
Is it possible to sample code? I still don’t understand, that is, I understand, but still I can’t catch something in my thoughts, that is, to do it
Its a little more complicated when you want to script abilities. As the person above (@PhAnToMjose4605) said, you could use Context Action Service (Or UserInputService) to deteck Key Input.
But once you have key input detection, its all about what you want the ability to be and what functions or methods you’ll do to achieve it. I’d suggest reading more into scripting articles/watching tutorials.
https://create.roblox.com/docs/tutorials/scripting/input-and-camera/detecting-user-input
https://create.roblox.com/docs/reference/engine/classes/UserInputService
Note for OP:
I don’t recommend UserInputService. It works very nicely but ContextActionService allows for setting of priorities and allows to bind to multiple binds on Xbox and mobile. It makes compatibility easier.