so basically i want to make a ability where the more u hold it the stronger and bigger it gets when it hits 4 sec or somehting it will fire the ability
thx for the help :D
Here is the code
Sorry for my english hope you understand me
01 | local UserInput = game:GetService( "UserInputService" ) |
02 | local Before = tick() --Current tick time |
03 | local Pressed = false --If key was pressed before |
04 |
05 | UserInput.InputBegan:Connect( function (Key,Processed) |
06 | if not (Processed) then |
07 | if (Key.KeyCode = = Enum.KeyCode.B) then --Key, Enum.KeyCode[Key] |
08 | Before = tick() --Current tick time |
09 | Pressed = true --Key was pressed |
10 | print ( "Key was pressed" ) |
11 | end |
12 | end |
13 | end ) |
14 | UserInput.InputEnded:Connect( function (Key) |
15 | if (Key.KeyCode = = Enum.KeyCode.B) then --Key, the same as above |
Closed as Not Constructive by BestCreativeBoy, imKirda, and DeceptiveCaster
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?