if anyone is to lazy local uis = game:GetService("UserInputService") local player = game.Players.LocalPlayer local mouse = player:GetMouse() local char = player.Character or player.CharacterAdded:Wait() local hrp = char:WaitForChild("HumanoidRootPart") local debounce = false local Wkey = false local Akey = false local Skey = false local Dkey = false mouse.KeyDown:Connect(function(key) if key == "w" then Wkey = true elseif key == "a" then Akey = true elseif key == "s" then Skey = true elseif key == "d" then Dkey = true end end) mouse.KeyUp:Connect(function(key) if key == "w" then Wkey = false elseif key == "a" then Akey = false elseif key == "s" then Skey = false elseif key == "d" then Dkey = false end end) uis.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.E and not debounce then debounce = true local vel = Instance.new("BodyVelocity") vel.MaxForce = Vector3.new(math.huge, math.huge, math.huge) if Wkey then vel.Velocity = hrp.CFrame.LookVector * 100 elseif Akey then vel.Velocity = hrp.CFrame.RightVector * -100 elseif Skey then vel.Velocity = hrp.CFrame.RightVector * 100 else vel.Velocity = Vector3.new(0, 0, 0) end vel.Parent = hrp game.Debris:AddItem(vel, 0.2) wait(1) debounce = false end end)
@@unomasunohjnds your welcome also there is a little bit broken on the script but it's not that bad it still mostly works because I didn't fully follow the tutorial.
body velocity may be depricated but it works perfectly fine, it just doesn't work on attachments like the new systems do (at least this is what I have seen from a bit of research)
LinearVelocity has replaced it, although it's a bit broken, as when i used DevMelon's slide tutorial it started to fling my avatar whenever i tried to slide (which the solution to that was using roblox's new physics character controller.)
I made an upgraded system that is a lot shorter: local uis = game:GetService("UserInputService") local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:Wait() local hrp = char:WaitForChild("HumanoidRootPart") local cam = workspace.CurrentCamera local debounce = false local cooldown = 1 uis.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.E and not debounce then debounce = true local vel = Instance.new("BodyVelocity") vel.MaxForce = Vector3.new(math.huge, math.huge, math.huge) if uis:IsKeyDown(Enum.KeyCode.W) then local vect = cam.CFrame.LookVector * 100 vel.Velocity = Vector3.new(vect.X, 0, vect.Z) elseif uis:IsKeyDown(Enum.KeyCode.A) then local vect = cam.CFrame.RightVector * -100 vel.Velocity = Vector3.new(vect.X, 0, vect.Z) elseif uis:IsKeyDown(Enum.KeyCode.S) then local vect = cam.CFrame.LookVector * -100 vel.Velocity = Vector3.new(vect.X, 0, vect.Z) elseif uis:IsKeyDown(Enum.KeyCode.D) then local vect = cam.CFrame.RightVector * 100 vel.Velocity = Vector3.new(vect.X, 0, vect.Z) end vel.Parent = hrp game.Debris:AddItem(vel, 0.2) wait(cooldown) debounce = false end end)
i found a bug: if you dash without pressing any key, your character will move a bit, i did this to fix: (after the "D key" elseif) else vel.MaxForce = Vector3.new(0,0,0) end that was just a little bug, still a very good script, you are welcome
@@LuvasTheGloves Yo man thank you for taking the time to improve my own code. I actually had already edited it to do that after I had made this comment but I didnt edit it since I had already added elements of my own game to the code but I thank you for your support Here is the code with the new edits: local uis = game:GetService("UserInputService") local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:Wait() local hrp = char:WaitForChild("HumanoidRootPart") local cam = workspace.CurrentCamera local debounce = false local cooldown = 1 uis.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.E and not debounce then debounce = true local vel = Instance.new("BodyVelocity") vel.MaxForce = Vector3.new(math.huge, math.huge, math.huge) if uis:IsKeyDown(Enum.KeyCode.W) then local vect = cam.CFrame.LookVector * 100 vel.Velocity = Vector3.new(vect.X, 0, vect.Z) elseif uis:IsKeyDown(Enum.KeyCode.A) then local vect = cam.CFrame.RightVector * -100 vel.Velocity = Vector3.new(vect.X, 0, vect.Z) elseif uis:IsKeyDown(Enum.KeyCode.S) then local vect = cam.CFrame.LookVector * -100 vel.Velocity = Vector3.new(vect.X, 0, vect.Z) elseif uis:IsKeyDown(Enum.KeyCode.D) then local vect = cam.CFrame.RightVector * 100 vel.Velocity = Vector3.new(vect.X, 0, vect.Z) else local vect = cam.CFrame.LookVector * 100 vel.Velocity = Vector3.new(vect.X, 0, vect.Z) end vel.Parent = hrp game.Debris:AddItem(vel, 0.2) wait(cooldown) debounce = false end end)
I cant show my code now but I later used a vector force (It was that or a linear force) instead of a body velocity. That was better for 2 ways: It meant gravity actually had an effect on you and if you dashed in the air it would just make you go foward, and 2nd body velocity is depricated. Ill try and post my code within 24 hours Im quite busy atm
Try using the :GetPartsinPart() to see if the player is overlapping with the wall and not allow the dash. Other than that I’m not really sure I’ll have to look into it
@@RandomEdittsss I had this issue but I made a gui button then you have to remake almost the whole script hope you found out how to do before I made this comment
You need to provide the assest Id of your animations that you have published to Roblox, make sure you publish it as a group owned animation and not a animation created by you to avoid future complications. Hope this helps
@@DeathDany714 u just have to edit the script by placing the animation I’d of your animations into the places where the animation is allready put, for example in the script replace the dash id whihh your own dash id
Heres the full script local UIS = game:GetService("UserInputService") local player = game.Players.LocalPlayer local Mouse = player:GetMouse() local char = script.Parent local HRP = char:WaitForChild("HumanoidRootPart") local debounce = false local WKey = false local AKey = false local SKey = false local DKey = false Mouse.KeyDown:Connect(function(key) if key == "w" then WKey = true elseif key == "a" then AKey = true elseif key == "s" then SKey = true elseif key == "d" then DKey = true end end) Mouse.KeyUp:Connect(function(key) if key == "w" then WKey = false elseif key == "a" then AKey = false elseif key == "s" then SKey = false elseif key == "d" then DKey = false end end) UIS.InputBegan:Connect(function(Key, gameProcessedEvent) if gameProcessedEvent then return end -- Prevent action if the game processes the event if Key.KeyCode == Enum.KeyCode.E and not debounce then local vel = Instance.new("BodyVelocity") vel.MaxForce = Vector3.new(math.huge, 0, math.huge) if WKey then vel.Velocity = HRP.CFrame.LookVector * 100 elseif AKey then vel.Velocity = HRP.CFrame.RightVector * -100 elseif SKey then vel.Velocity = HRP.CFrame.LookVector * -100 elseif DKey then vel.Velocity = HRP.CFrame.RightVector * 100 end vel.Parent = HRP game.Debris:AddItem(vel, 0.2) debounce = true wait(1) debounce = false end end)
local UIS = game;GetService("UserInputService") local Player = game.Players.LocalPlayer local mouse = Player:GetMouse() local char = script.Parent local HRP = Char:WaitForChild("HumanoidRootPart") local debounce = false local WKey = false local AKey = false local SKey = false local DKey = false Mouse.KeyDown:Connect(function(key) if key == "w" then WKey = true elseif key == "a" then AKey = true elseif key == "s" then SKey = true elseif key == "d" then DKey = true end end) Mouse.KeyUp:Connect(function(key) if key == "w" then WKey = false elseif key == "a" then AKey = false elseif key == "s" then SKey = false elseif key == "d" then DKey = false end end) UIS.InputBegan:Connect(function(key) if key.KeyCode == Enum.KeyCode.E then if WKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,0,math.huge) vel.Velocity = HRP.CFrame.lookVector*100 game.Debris:AddItem(vel,.2) wait(1) debounce = false end elseif AKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,0,math.huge) vel.Velocity = HRP.CFrame.RightVector*-100 game.Debris:AddItem(vel,.2) wait(1) debounce = false end elseif SKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,0,math.huge) vel.Velocity = HRP.CFrame.LookVector*-100 game.Debris:AddItem(vel,.2) wait(1) debounce = false end elseif DKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,0,math.huge) vel.Velocity = HRP.CFrame.RightVector*100 game.Debris:AddItem(vel,.2) wait(1) debounce = false end end end
@@Bobr4it's kinda has a lot of steps but you can animate in the animation editor inside avatar, or get the "Moon Animator" Plugin then paste the animation id to the Animation(Object)
Hi dev melon ive been having in this tutorial recently ive been watching for 3 days and still some errors can you send me the script and i can finally make my dash in my future game
theres a but of broken code in the comment you pasted heres the fix i made local vel = Instance.new("BodyVelocity") vel.MaxForce = Vector3.new(math.huge, math.huge, math.huge) if Wkey then vel.Velocity = hrp.CFrame.LookVector * 100 elseif Akey then vel.Velocity = hrp.CFrame.RightVector * -100 elseif Dkey then vel.Velocity = hrp.CFrame.RightVector * 100 elseif Skey then vel.Velocity = hrp.CFrame.LookVector * -100 else vel.Velocity = Vector3.new(0, 0, 0) end
local UIS = game;GetService("UserInputService") local Player = game.Players.LocalPlayer local mouse = Player:GetMouse() local char = script.Parent local HRP = Char:WaitForChild("HumanoidRootPart") local debounce = false local WKey = false local AKey = false local SKey = false local DKey = false Mouse.KeyDown:Connect(function(key) if key == "w" then WKey = true elseif key == "a" then AKey = true elseif key == "s" then SKey = true elseif key == "d" then DKey = true end end) Mouse.KeyUp:Connect(function(key) if key == "w" then WKey = false elseif key == "a" then AKey = false elseif key == "s" then SKey = false elseif key == "d" then DKey = false end end) UIS.InputBegan:Connect(function(key) if key.KeyCode == Enum.KeyCode.E then if WKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,0,math.huge) vel.Velocity = HRP.CFrame.lookVector*100 game.Debris:AddItem(vel,.2) wait(1) debounce = false end elseif AKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,0,math.huge) vel.Velocity = HRP.CFrame.RightVector*-100 game.Debris:AddItem(vel,.2) wait(1) debounce = false end elseif SKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,0,math.huge) vel.Velocity = HRP.CFrame.LookVector*-100 game.Debris:AddItem(vel,.2) wait(1) debounce = false end elseif DKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,0,math.huge) vel.Velocity = HRP.CFrame.RightVector*100 game.Debris:AddItem(vel,.2) wait(1) debounce = false end end end
I'm leaving this comment here cuz I'm lazy as hell and can't finish this today so I can see this video tomorrow come to my point and keep scripting! 6:07
local UIS = game:GetService("UserInputService") local Player = game.Players.LocalPlayer local mouse = Player:GetMouse() local char = script.Parent local HRP = Char.WaitForChild("HumanoidRootPart") local debounce = false local WKey = false local AKey = false local SKey = false local DKey = false Mouse.KeyDown:Connect(function(key) if key == "w" then WKey = true elseif key == "a" then AKey = true elseif key == "s" then SKey = true elseif key == "d" then DKey = true end end) Mouse.KeyUp:Connect(function(key) if key == "w" then WKey = false elseif key == "a" then AKey = false elseif key == "s" then SKey = false elseif key == "d" then DKey = false end end) UIS.InputBegan:Connect(function(key) if key.KeyCode == Enum.KeyCode.E then if WKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,math.huge) vel.Velocity = HRP.CFrame.lookVector*100 game.Debris:AddItem(vel,0.2) debounce = true wait(1) debounce = false end elseif AKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,math.huge) vel.Velocity = HRP.CFrame.RightVector*-100 game.Debris:AddItem(vel,0.2) debounce = true wait(1) debounce = false end elseif SKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,math.huge) vel.Velocity = HRP.CFrame.LookVector*-100 game.Debris:AddItem(vel,0.2) debounce = true wait(1) debounce = false end elseif DKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,math.huge) vel.Velocity = HRP.CFrame.RightVector*100 game.Debris:AddItem(vel,0.2) debounce = true wait(1) debounce = false end end end end)
U r using a 5 months old tutorial. Some methods have since been deprecated. So before making this effortless comment, did u try...idk...looking up the forums documentations? Or any other way to make it work?
script local UIS = game:GetService("UserInputService") local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() local Char = script.Parent local HRP = Char:WaitForChild("HumanoidRootPart") local debounce = false local WKey = false local AKey = false local SKey = false local DKey = false Mouse.KeyDown:Connect(function(key) if key == "w" then WKey = true elseif key == "a" then AKey = true elseif key == "s" then SKey = true elseif key == "d" then DKey = true end end) Mouse.KeyUp:Connect(function(key) if key == "w" then WKey = false elseif key == "a" then AKey = false elseif key == "s" then SKey = false elseif key == "d" then DKey = false end end) UIS.InputBegan:Connect(function(input, gameProcessed) if input.KeyCode == Enum.KeyCode.E then if WKey or AKey or SKey or DKey then if debounce == false then local vel = Instance.new("BodyVelocity", HRP) vel.MaxForce = Vector3.new(math.huge, 0, math.huge)
if WKey then vel.Velocity = HRP.CFrame.LookVector * 100 elseif AKey then vel.Velocity = -HRP.CFrame.RightVector * 100 elseif SKey then vel.Velocity = -HRP.CFrame.LookVector * 100 elseif DKey then vel.Velocity = HRP.CFrame.RightVector * 100 end
game.Debris:AddItem(vel, 0.2) debounce = true wait(0.5) debounce = false end end end end) Hope this help :)
local UIS = game:GetService("UserInputService") local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() local Char = script.Parent local HRP Char:WaitForChild("HumanoidRootPart") local debounce = false local WKey = false local AKey = false local SKey = false local DKey = false Mouse.KeyDown:Connect(function(key) if key == "w" then WKey = true elseif key == "a" then AKey = true elseif key == "s" then SKey = true elseif key == "d" then DKey = true end end) Mouse.KeyUp:Connect(function(key) if key == "w" then WKey = false elseif key == "a" then AKey = false elseif key == "s" then SKey = false elseif key == "d" then DKey = false end end) UIS.InputBegan:Connect(function(key) if key.KeyCode == Enum.KeyCode.C then if WKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,math.huge) vel.Velocity = HRP.CFrame.LookVector*100 game.Debris:AddItem(vel,0.2) debounce = true wait(1) debounce = false end elseif AKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,math.huge) vel.Velocity = HRP.CFrame.RightVector*-100 game.Debris:AddItem(vel,0.2) debounce = true wait(1) debounce = false end elseif SKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,math.huge) vel.Velocity = HRP.CFrame.LookVector*-100 game.Debris:AddItem(vel,0.2) debounce = true wait(1) debounce = false end elseif DKey == true then if debounce == false then local vel = Instance.new("BodyVelocity",HRP) vel.MaxForce = Vector3.new(math.huge,0,math.huge) vel.Velocity = HRP.CFrame.RightVector*100 game.Debris:AddItem(vel,0.2) debounce = true wait(1) debounce = false end end end end) Error :3: attempt to index nil with 'GetMouse' anywhere I made a mistake or typo?
0:49 bro's grades are better than mine
😭
i thought h- was the lowest [h = horrible]
if anyone is to lazy
local uis = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local char = player.Character or player.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local debounce = false
local Wkey = false
local Akey = false
local Skey = false
local Dkey = false
mouse.KeyDown:Connect(function(key)
if key == "w" then
Wkey = true
elseif key == "a" then
Akey = true
elseif key == "s" then
Skey = true
elseif key == "d" then
Dkey = true
end
end)
mouse.KeyUp:Connect(function(key)
if key == "w" then
Wkey = false
elseif key == "a" then
Akey = false
elseif key == "s" then
Skey = false
elseif key == "d" then
Dkey = false
end
end)
uis.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.E and not debounce then
debounce = true
local vel = Instance.new("BodyVelocity")
vel.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
if Wkey then
vel.Velocity = hrp.CFrame.LookVector * 100
elseif Akey then
vel.Velocity = hrp.CFrame.RightVector * -100
elseif Skey then
vel.Velocity = hrp.CFrame.RightVector * 100
else
vel.Velocity = Vector3.new(0, 0, 0)
end
vel.Parent = hrp
game.Debris:AddItem(vel, 0.2)
wait(1)
debounce = false
end
end)
thanks
@@unomasunohjnds your welcome also there is a little bit broken on the script but it's not that bad it still mostly works because I didn't fully follow the tutorial.
Bro even did a better script
?
goat
funny how it says "advanced dash system" while he makes the most painful and inefficient script ive ever seen
-usage of bodyvel
-using deprecated mouse.Key events and THEN using uis.Input events right after 😭😭😭😭😭😭😭
Thank you broooo, u make it so simple i understand everything
the only thing that could be a flaw in this is using body velocity since its depricated. But nice tutorial.
I guess
body velocity may be depricated but it works perfectly fine, it just doesn't work on attachments like the new systems do (at least this is what I have seen from a bit of research)
LinearVelocity has replaced it, although it's a bit broken, as when i used DevMelon's slide tutorial it started to fling my avatar whenever i tried to slide (which the solution to that was using roblox's new physics character controller.)
Does anyone know how I could edit the script so you'll dash even if youre not moving?
Bro your intros are always fire, love it
Appreciate that
I made an upgraded system that is a lot shorter:
local uis = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local cam = workspace.CurrentCamera
local debounce = false
local cooldown = 1
uis.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.E and not debounce then
debounce = true
local vel = Instance.new("BodyVelocity")
vel.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
if uis:IsKeyDown(Enum.KeyCode.W) then
local vect = cam.CFrame.LookVector * 100
vel.Velocity = Vector3.new(vect.X, 0, vect.Z)
elseif uis:IsKeyDown(Enum.KeyCode.A) then
local vect = cam.CFrame.RightVector * -100
vel.Velocity = Vector3.new(vect.X, 0, vect.Z)
elseif uis:IsKeyDown(Enum.KeyCode.S) then
local vect = cam.CFrame.LookVector * -100
vel.Velocity = Vector3.new(vect.X, 0, vect.Z)
elseif uis:IsKeyDown(Enum.KeyCode.D) then
local vect = cam.CFrame.RightVector * 100
vel.Velocity = Vector3.new(vect.X, 0, vect.Z)
end
vel.Parent = hrp
game.Debris:AddItem(vel, 0.2)
wait(cooldown)
debounce = false
end
end)
yo tysm it works in my game unlike the other scripts i tried using
i found a bug: if you dash without pressing any key, your character will move a bit, i did this to fix:
(after the "D key" elseif)
else
vel.MaxForce = Vector3.new(0,0,0)
end
that was just a little bug, still a very good script, you are welcome
or you can do something like this:
else
local vect = hrp.CFrame.LookVector * 100
vel.Velocity = Vector3.new(vect.X, 0, vect.Z)
end
@@LuvasTheGloves Yo man thank you for taking the time to improve my own code. I actually had already edited it to do that after I had made this comment but I didnt edit it since I had already added elements of my own game to the code but I thank you for your support
Here is the code with the new edits:
local uis = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local cam = workspace.CurrentCamera
local debounce = false
local cooldown = 1
uis.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.E and not debounce then
debounce = true
local vel = Instance.new("BodyVelocity")
vel.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
if uis:IsKeyDown(Enum.KeyCode.W) then
local vect = cam.CFrame.LookVector * 100
vel.Velocity = Vector3.new(vect.X, 0, vect.Z)
elseif uis:IsKeyDown(Enum.KeyCode.A) then
local vect = cam.CFrame.RightVector * -100
vel.Velocity = Vector3.new(vect.X, 0, vect.Z)
elseif uis:IsKeyDown(Enum.KeyCode.S) then
local vect = cam.CFrame.LookVector * -100
vel.Velocity = Vector3.new(vect.X, 0, vect.Z)
elseif uis:IsKeyDown(Enum.KeyCode.D) then
local vect = cam.CFrame.RightVector * 100
vel.Velocity = Vector3.new(vect.X, 0, vect.Z)
else
local vect = cam.CFrame.LookVector * 100
vel.Velocity = Vector3.new(vect.X, 0, vect.Z)
end
vel.Parent = hrp
game.Debris:AddItem(vel, 0.2)
wait(cooldown)
debounce = false
end
end)
I cant show my code now but I later used a vector force (It was that or a linear force) instead of a body velocity. That was better for 2 ways: It meant gravity actually had an effect on you and if you dashed in the air it would just make you go foward, and 2nd body velocity is depricated.
Ill try and post my code within 24 hours Im quite busy atm
this will come in handy for my doom but in roblox game
How can you modify this script to include an animation that plays when you dash in certain directions ?
When you add the bodyvelocity you do
anim = Humanoid:LoadAnimation(Animation)
anim:Play()
@@devmelonrobloxokay thank you :)
@@devmelonroblox erm it says unknown global humanoid and animation you think you could help me with that?
@@happyperkiness746hey did this work for you??
@@turtledude8852 bro u hv to put the variables for humanoid and char first
get the plrs character and his humanoid
Works thanks but when you dash into wall its just flys away. can you fix ithat?
Try using the :GetPartsinPart() to see if the player is overlapping with the wall and not allow the dash. Other than that I’m not really sure I’ll have to look into it
Hey good video but i have one bug. If i side dash and and then hold w i do another dash even tho im not holding q?
So like, do i literally have to press W,A,S or D to dash, or is there another button, because I’m confused.
thanks but what key do i press to dash?
E you can also change it at string 37 after "Enum.KeyCode.(your key)"
@@bacon_craft385 can you make it so you double tap space bar and how will it work for mobile users?
It doesn’t work😭
@@RandomEdittsss I had this issue but I made a gui button then you have to remake almost the whole script hope you found out how to do before I made this comment
idk why it not work for me but when I try ask assistant its actually work
How do you make it play an animation?
Pretty new in coding (like new-born baby new) so how can i add my own animations in the dashes, plz help :)
You need to provide the assest Id of your animations that you have published to Roblox, make sure you publish it as a group owned animation and not a animation created by you to avoid future complications. Hope this helps
yeah, same issue
@@ItzVen6 how do i do it? what script i write?
@@DeathDany714 u just have to edit the script by placing the animation I’d of your animations into the places where the animation is allready put, for example in the script replace the dash id whihh your own dash id
"Wow! AI just did the whole script for me, but im not lazy so-"
BUT I AMMMMMMM
hello do you know how to add animation to my dash?
why is my dash not working even though i did every thing as you did
can you tell me what mic you use?
I use some random mic i found in my house i dont even know the name of it ahahah
I think its a Mackie em-usb
@@devmelonroblox love ur vids btw just added a dash system to my game
Nice vid it will help me alot
Glad I could help
Does the game have to be R15 or R6?
no
@@Sakplayer Wdym by that?
@@sinadostewelde7317 I think you ask about the game should R15 or R6 to make dash system. Well it doesn't matter to have R15 or R6 to make dash
i did everything step by step but script didnt work and nothings happening.
Do u get any errors
is there a way to attach a animation onto it, i am a starter scripter and this would help alot.
how do i also apply animations to it? i want to make dashes with animations
How do i add an animation to the dash?
Heres the full script
local UIS = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local Mouse = player:GetMouse()
local char = script.Parent
local HRP = char:WaitForChild("HumanoidRootPart")
local debounce = false
local WKey = false
local AKey = false
local SKey = false
local DKey = false
Mouse.KeyDown:Connect(function(key)
if key == "w" then
WKey = true
elseif key == "a" then
AKey = true
elseif key == "s" then
SKey = true
elseif key == "d" then
DKey = true
end
end)
Mouse.KeyUp:Connect(function(key)
if key == "w" then
WKey = false
elseif key == "a" then
AKey = false
elseif key == "s" then
SKey = false
elseif key == "d" then
DKey = false
end
end)
UIS.InputBegan:Connect(function(Key, gameProcessedEvent)
if gameProcessedEvent then return end -- Prevent action if the game processes the event
if Key.KeyCode == Enum.KeyCode.E and not debounce then
local vel = Instance.new("BodyVelocity")
vel.MaxForce = Vector3.new(math.huge, 0, math.huge)
if WKey then
vel.Velocity = HRP.CFrame.LookVector * 100
elseif AKey then
vel.Velocity = HRP.CFrame.RightVector * -100
elseif SKey then
vel.Velocity = HRP.CFrame.LookVector * -100
elseif DKey then
vel.Velocity = HRP.CFrame.RightVector * 100
end
vel.Parent = HRP
game.Debris:AddItem(vel, 0.2)
debounce = true
wait(1)
debounce = false
end
end)
ey bro it stopped all of my animations ! can you help me
help! I did everything right but nothing happend what should i do?
@@Shernxuengoh then you didn’t do everything right check your output and tell me the error you get
what is the script to play an animation, i created one but i dont know how to add it when doing dash
local animation = plr.Character.Humanoid:LoadAnimation(script.Animation)
animation:Play() (btw the animation have to be in the script
)
local UIS = game;GetService("UserInputService")
local Player = game.Players.LocalPlayer
local mouse = Player:GetMouse()
local char = script.Parent
local HRP = Char:WaitForChild("HumanoidRootPart")
local debounce = false
local WKey = false
local AKey = false
local SKey = false
local DKey = false
Mouse.KeyDown:Connect(function(key)
if key == "w" then
WKey = true
elseif key == "a" then
AKey = true
elseif key == "s" then
SKey = true
elseif key == "d" then
DKey = true
end
end)
Mouse.KeyUp:Connect(function(key)
if key == "w" then
WKey = false
elseif key == "a" then
AKey = false
elseif key == "s" then
SKey = false
elseif key == "d" then
DKey = false
end
end)
UIS.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.E then
if WKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,0,math.huge)
vel.Velocity = HRP.CFrame.lookVector*100
game.Debris:AddItem(vel,.2)
wait(1)
debounce = false
end
elseif AKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,0,math.huge)
vel.Velocity = HRP.CFrame.RightVector*-100
game.Debris:AddItem(vel,.2)
wait(1)
debounce = false
end
elseif SKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,0,math.huge)
vel.Velocity = HRP.CFrame.LookVector*-100
game.Debris:AddItem(vel,.2)
wait(1)
debounce = false
end
elseif DKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,0,math.huge)
vel.Velocity = HRP.CFrame.RightVector*100
game.Debris:AddItem(vel,.2)
wait(1)
debounce = false
end
end
end
You make a couple typos in the script
@@Drxpyoutube at the start where you did local UIS instead of ; do :
Still didnt work
Says Workspace.guap4088.LocalScript:77: Expected ‘end’ (to close ‘function’ at line 36), got ; did you forget to close ‘then at line 66
Read the error at like 66 you to add end to close the function
THANKS U SO MUCH, I have did ur sword attack tutorial and it was very good,so thank u for this tutorial!🎉
You’re welcome!
Hello Bro, your content is good, don't stop.👍
Thanks!
I have the same code but every time I press E and any other key it doesn’t work
you have to make an animation first
@@croosh1467 how to make an animation?
@@Bobr4it's kinda has a lot of steps but you can animate in the animation editor inside avatar, or get the "Moon Animator" Plugin then paste the animation id to the Animation(Object)
now how do i change the animation?
Why doesnt anything that i do from tutorials not work can u tell me why pls
Probably spelling mistakes like capital letters check your output for errors
Did not work ):
Nice video! BTW what does body velocity do?
It applies a force on the object
To move it
how to add a animation to it?
Hi dev melon ive been having in this tutorial recently ive been watching for 3 days and still some errors can you send me the script and i can finally make my dash in my future game
Bro is that for R6 too?
I'd assume so
It works but when i click s i dash to the right and when i click d nothing happens
theres a but of broken code in the comment you pasted heres the fix i made
local vel = Instance.new("BodyVelocity")
vel.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
if Wkey then
vel.Velocity = hrp.CFrame.LookVector * 100
elseif Akey then
vel.Velocity = hrp.CFrame.RightVector * -100
elseif Dkey then
vel.Velocity = hrp.CFrame.RightVector * 100
elseif Skey then
vel.Velocity = hrp.CFrame.LookVector * -100
else
vel.Velocity = Vector3.new(0, 0, 0)
end
@@awesomewolf7197 ty
Can you make a boomerang weapon basicly a throw weapon that comes back
I sure might make a vid on this soon
Does this work on the server side?¿
can you make one with a cd gui in it
can u give me the script so i dont have to write it down ;-; ? THANK U
Ppl do this so other ppl actually watch the video
local UIS = game;GetService("UserInputService")
local Player = game.Players.LocalPlayer
local mouse = Player:GetMouse()
local char = script.Parent
local HRP = Char:WaitForChild("HumanoidRootPart")
local debounce = false
local WKey = false
local AKey = false
local SKey = false
local DKey = false
Mouse.KeyDown:Connect(function(key)
if key == "w" then
WKey = true
elseif key == "a" then
AKey = true
elseif key == "s" then
SKey = true
elseif key == "d" then
DKey = true
end
end)
Mouse.KeyUp:Connect(function(key)
if key == "w" then
WKey = false
elseif key == "a" then
AKey = false
elseif key == "s" then
SKey = false
elseif key == "d" then
DKey = false
end
end)
UIS.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.E then
if WKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,0,math.huge)
vel.Velocity = HRP.CFrame.lookVector*100
game.Debris:AddItem(vel,.2)
wait(1)
debounce = false
end
elseif AKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,0,math.huge)
vel.Velocity = HRP.CFrame.RightVector*-100
game.Debris:AddItem(vel,.2)
wait(1)
debounce = false
end
elseif SKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,0,math.huge)
vel.Velocity = HRP.CFrame.LookVector*-100
game.Debris:AddItem(vel,.2)
wait(1)
debounce = false
end
elseif DKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,0,math.huge)
vel.Velocity = HRP.CFrame.RightVector*100
game.Debris:AddItem(vel,.2)
wait(1)
debounce = false
end
end
end
@@C00lkidd_Reborn TYSMM
Tysm this work
can someone please get a full and working script cuz im aint copying all of that
Can Someone Teach Me On How to put Animation to the dash😅
I'm leaving this comment here cuz I'm lazy as hell and can't finish this today so I can see this video tomorrow come to my point and keep scripting!
6:07
the script works (only in shift lock) but it is way overcomplicated
@@Sycro11 yeah sorry I’m not perfect at scripting 😅
I have no clue how to do this I copied it exactly and only added a few lines to add my own animation and it doesn’t work 😭😭
u have to make an animation first
I tried it out and nothing happen when I clicked E
what key do i press when done
heres the script i dont see the problem
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local mouse = Player:GetMouse()
local char = script.Parent
local HRP = Char.WaitForChild("HumanoidRootPart")
local debounce = false
local WKey = false
local AKey = false
local SKey = false
local DKey = false
Mouse.KeyDown:Connect(function(key)
if key == "w" then
WKey = true
elseif key == "a" then
AKey = true
elseif key == "s" then
SKey = true
elseif key == "d" then
DKey = true
end
end)
Mouse.KeyUp:Connect(function(key)
if key == "w" then
WKey = false
elseif key == "a" then
AKey = false
elseif key == "s" then
SKey = false
elseif key == "d" then
DKey = false
end
end)
UIS.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.E then
if WKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,math.huge)
vel.Velocity = HRP.CFrame.lookVector*100
game.Debris:AddItem(vel,0.2)
debounce = true
wait(1)
debounce = false
end
elseif AKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,math.huge)
vel.Velocity = HRP.CFrame.RightVector*-100
game.Debris:AddItem(vel,0.2)
debounce = true
wait(1)
debounce = false
end
elseif SKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,math.huge)
vel.Velocity = HRP.CFrame.LookVector*-100
game.Debris:AddItem(vel,0.2)
debounce = true
wait(1)
debounce = false
end
elseif DKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,math.huge)
vel.Velocity = HRP.CFrame.RightVector*100
game.Debris:AddItem(vel,0.2)
debounce = true
wait(1)
debounce = false
end
end
end
end)
@ricemmanuellallana2076 You put the variables wrong bro, change the local mouse to local Mouse and local characters to local Char
isnt body vel deprecated
It worked in the video 🤔
It doesnt work and i have no errors
I't doesn't work for me
How do I make it work for mobile?
@@TheRealAamirPreddie make a gui button then you just have to remake the whole button script
@ ok thanks
Did not work, also heck you for not having the code in the description!
Redo how to make a worming sword jn Roblox
YESSS
YEAAAA
not a good idea to use deprecated stuff
it didnt work.
can u put the script in the comments pls
Lier it never worked and my script is now broke an
I’m not lying why woood I lie, just tell me what error u get 🤷♂️
U r using a 5 months old tutorial. Some methods have since been deprecated. So before making this effortless comment, did u try...idk...looking up the forums documentations? Or any other way to make it work?
4:28
JUST HAD ME WASTE MY TIME IT DIDNT WORK
Instead of saying it didn’t work say what actually didn’t work and what error you have so I could help
Skill issue
can some one post the script in comments?
script
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Char = script.Parent
local HRP = Char:WaitForChild("HumanoidRootPart")
local debounce = false
local WKey = false
local AKey = false
local SKey = false
local DKey = false
Mouse.KeyDown:Connect(function(key)
if key == "w" then
WKey = true
elseif key == "a" then
AKey = true
elseif key == "s" then
SKey = true
elseif key == "d" then
DKey = true
end
end)
Mouse.KeyUp:Connect(function(key)
if key == "w" then
WKey = false
elseif key == "a" then
AKey = false
elseif key == "s" then
SKey = false
elseif key == "d" then
DKey = false
end
end)
UIS.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.E then
if WKey or AKey or SKey or DKey then
if debounce == false then
local vel = Instance.new("BodyVelocity", HRP)
vel.MaxForce = Vector3.new(math.huge, 0, math.huge)
if WKey then
vel.Velocity = HRP.CFrame.LookVector * 100
elseif AKey then
vel.Velocity = -HRP.CFrame.RightVector * 100
elseif SKey then
vel.Velocity = -HRP.CFrame.LookVector * 100
elseif DKey then
vel.Velocity = HRP.CFrame.RightVector * 100
end
game.Debris:AddItem(vel, 0.2)
debounce = true
wait(0.5)
debounce = false
end
end
end
end)
Hope this help :)
thx
Can jou zet de script in de comments
Abouta see if it works
Did not work
You sure you wrote it right did u get any errorsv
@@devmelonrobloxI wrote it right
it doesnt work
What does work exactly saying it doesn’t work doesn’t help
mobile players...
bro u made me waste 5 more mins bc u did't want the ai stuff😢
@@レブlevv wdym what?
@@レブlevv ahahaha
2nd😢
Nooooooooooo
Does this work on the server side?¿
do you mean would this work in a server script, or does it replicate to the server ?
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Char = script.Parent
local HRP Char:WaitForChild("HumanoidRootPart")
local debounce = false
local WKey = false
local AKey = false
local SKey = false
local DKey = false
Mouse.KeyDown:Connect(function(key)
if key == "w" then
WKey = true
elseif key == "a" then
AKey = true
elseif key == "s" then
SKey = true
elseif key == "d" then
DKey = true
end
end)
Mouse.KeyUp:Connect(function(key)
if key == "w" then
WKey = false
elseif key == "a" then
AKey = false
elseif key == "s" then
SKey = false
elseif key == "d" then
DKey = false
end
end)
UIS.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.C then
if WKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,math.huge)
vel.Velocity = HRP.CFrame.LookVector*100
game.Debris:AddItem(vel,0.2)
debounce = true
wait(1)
debounce = false
end
elseif AKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,math.huge)
vel.Velocity = HRP.CFrame.RightVector*-100
game.Debris:AddItem(vel,0.2)
debounce = true
wait(1)
debounce = false
end
elseif SKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,math.huge)
vel.Velocity = HRP.CFrame.LookVector*-100
game.Debris:AddItem(vel,0.2)
debounce = true
wait(1)
debounce = false
end
elseif DKey == true then
if debounce == false then
local vel = Instance.new("BodyVelocity",HRP)
vel.MaxForce = Vector3.new(math.huge,0,math.huge)
vel.Velocity = HRP.CFrame.RightVector*100
game.Debris:AddItem(vel,0.2)
debounce = true
wait(1)
debounce = false
end
end
end
end)
Error :3: attempt to index nil with 'GetMouse'
anywhere I made a mistake or typo?
W guy
you forgot the "=" when classifying HRP as the humanoid root part
doesnt work