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:
plr = game:GetService("Players").LocalPlayer
cooldown = false
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/asset/?id=1541393089"
local particles = game:GetService("ReplicatedStorage").Particle
function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.Z and cooldown ~= false then
local CloneP1, CloneP2 = particles:Clone(), particles:Clone()
CloneP1.Parent = plr.Character.RightHand; CloneP1.Enabled = true
CloneP2.Parent = plr.Character.LeftHand; CloneP2.Enabled = true
cooldown = true
local playAnim = plr.Character.Humanoid:LoadAnimation(anim)
playAnim:Play()
plr.Character.Humanoid.WalkSpeed = 40
wait(1.6)
CloneP1:Destroy(); CloneP2:Destroy()
plr.Character.Humanoid.WalkSpeed = 16
wait(3)
print("Explosion Dash")
cooldown = false
end
end
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
2 comments
lol it dont even work there are no instances, and you were telling me to use them M8 u dont even use them myself. you just disabled the script by doing what you did
^ Did you really just copy paste the whole script without reading it? If you read the whole answer and code, you’ll see where the particles come from.