Dash Velocity not working? (Module Script)

I made this script so I can have a similar effect to this:

This is what’s happening right now:

But The velocity isn’t working at all. Also, is there any way to design this script better?

When I go into the playtest to test it out. It only plays the animation and prints all the prints, there’s no velocity at all.

local module = {}

function module.Roll (plr,char)
	-- Services
	local RS = game:GetService("ReplicatedStorage")
	local SoundService = game:GetService("SoundService")
	-- Folders
	local RSStorage = RS.Storage
	local RSAnimations = RSStorage.Animations
	local SFXFolder = SoundService.SFX
	local RollSound = SFXFolder.Movement.Roll
	
	-- Values
	local Hum = char:WaitForChild("Humanoid")
	local HumRP = char:WaitForChild("HumanoidRootPart")
	local RollAnimation = Hum:LoadAnimation(RSAnimations.Movement.Roll)
	
	local RollDebounce = false
	local DashingDebounce = false
	local CanDoAnything = true
	
	-- Modules
	local SoundModule = require(RSStorage.Modules.Combat.SoundsModule)
	print ("Roll module")
	
	
	if RollDebounce == false and char:FindFirstChild("Disabled") == nil then
		RollDebounce = true
		CanDoAnything = false
		delay(0.3,function()
			CanDoAnything = true
		end)
		delay(2.5,function()
			RollDebounce = false
		end)
		Hum.JumpHeight = 0
		RollAnimation:Play()
		DashingDebounce = true
		-- Play with sounds module
		SoundModule.PlaySound(RollSound,char.Torso)
		delay(0.25,function()
			DashingDebounce = false
			Hum.JumpHeight = 7.2
		end)
		repeat
			HumRP.Velocity = HumRP.CFrame.lookVector * 130 / 1.5
			print ("Dash Velocity")
			wait(0.1)
		until DashingDebounce == false
		
	end
	
	if RollDebounce == true  then
		Hum.JumpHeight = 0 
		wait (0.5)
		Hum.JumpHeight = 7.2
	end
	
end




return module

Is this also all client-sided? It should be for smoother experience, and it will work completely fine without server-side.

But, to fix the issue. I think it’s becuase the velocity isn’t enough to push the HRP.

Add this code in:

repeat
			HumRP:ApplyImpulse( HumRP.CFrame.lookVector * humHRP.Mass * 10) -- Force equation, Force = Mass * Acceleration, This will allow the HRP to be moved, change the acceleration (10) to a higher number if you need to
			print ("Dash Velocity")
			task.wait(0.1) -- New version of wait, use it instead
		until DashingDebounce == false
3 Likes

Yeah of course I had it client sided (I just switched the events into bindablefunctions) Anyways this has the same effect nothing’s different. I could try it out putting it all into one local script instead of putting it into a module.

Oh nah that;s fine, but the pushing the character with a greater force didn’t work?