Answered by
7 years ago Edited 7 years ago
Okay, I see you didn't even try to even make the particle emmiters. Just so you know, this community doesn't give answers for free, you need to try and learn.
Now, I'll give a few tips before I answer your question.
- Use
:Connect
instead of :connect
, this last one is deprecated and its functionality might be deleted anytime.
- Now with
cooldown
variable, I see you only use 0
and 1
as its value, so you might want to use true
and false
, won't make any difference but your script will look nicer, just an opinion.
Now, I assume your script is a LocalScript due to UserInputService, which can only be accessed by client (if you don't know what I mean, then LocalScripts)
Now, I also assume you got your particles ready, if you got your particles done already then place them in ReplicatedStorage, and use this script:
01 | plr = game:GetService( "Players" ).LocalPlayer |
03 | local anim = Instance.new( "Animation" ) |
06 | local particles = game:GetService( "ReplicatedStorage" ).Particle |
08 | function onKeyPress(inputObject, gameProcessedEvent) |
09 | if inputObject.KeyCode = = Enum.KeyCode.Z and cooldown ~ = false then |
11 | local CloneP 1 , CloneP 2 = particles:Clone(), particles:Clone() |
12 | CloneP 1. Parent = plr.Character.RightHand; CloneP 1. Enabled = true |
13 | CloneP 2. Parent = plr.Character.LeftHand; CloneP 2. Enabled = true |
16 | local playAnim = plr.Character.Humanoid:LoadAnimation(anim) |
18 | plr.Character.Humanoid.WalkSpeed = 40 |
21 | CloneP 1 :Destroy(); CloneP 2 :Destroy() |
23 | plr.Character.Humanoid.WalkSpeed = 16 |
25 | print ( "Explosion Dash" ) |
30 | game:GetService( "UserInputService" ).InputBegan:Connect(onKeyPress) |
This script won't work with R6 unless you add some condicionals and stuff. Hope this helped!
NOTE: THIS IS NOT FE COMPATIBLE, for more information, see Experimental Mode and Remote Events and Functions