Dash

🧩 Syntax:
local RS = game:GetService('ReplicatedStorage')
local uis = game:GetService('UserInputService')
local speed = 120
local duration = .3
local cooldown = 5
local debounce = {}

RS.FlashStepDash.OnServerEvent:Connect(function(Player)
	if debounce[Player] then return end 
	debounce[Player] = true 
	
	local delete = {}
	local Transparency = {}
	
	local character = Player.Character
	local attachment = Instance.new('Attachment', character.HumanoidRootPart)
	local LinearVelocity = Instance.new('LinearVelocity', character.HumanoidRootPart)
	
	delete[#delete + 1] = attachment
	delete[#delete + 1] = LinearVelocity
	 
	LinearVelocity.MaxForce = 300000
	LinearVelocity.Attachment0 = attachment
	LinearVelocity.VelocityConstraintMode = Enum.VelocityConstraintMode.Line
	if uis:IsKeyDown(Enum.KeyCode.A) then
		LinearVelocity.LineDirection = Vector3.new(character.HumanoidRootPart.CFrame.LookVector.X, 0, character.HumanoidRootPart.CFrame.LookVector.Z.math.rad(270))
		elseif uis:IsKeyDown(Enum.KeyCode.D) then 
			LinearVelocity.LineDirection = Vector3.new(character.HumanoidRootPart.CFrame.LookVector.X, 0, character.HumanoidRootPart.CFrame.LookVector.Z.math.rad(90))
			elseif uis:IsKeyDown(Enum.KeyCode.S) then
				LinearVelocity.LineDirection = Vector3.new(character.HumanoidRootPart.CFrame.LookVector.X, 0, character.HumanoidRootPart.CFrame.LookVector.Z.math.rad(180))
				elseif uis:IsKeyDown(Enum.KeyCode.W) then 
					LinearVelocity.LineDirection = Vector3.new(character.HumanoidRootPart.CFrame.LookVector.X, 0, character.HumanoidRootPart.CFrame.LookVector.Z)
				end
			
	LinearVelocity.LineVelocity = speed
	
	local Particle = RS.BlackFlash
	local ClonedParticle =Particle:Clone()
	ClonedParticle.Parent = character.HumanoidRootPart
	delete[#delete+1] = ClonedParticle
	
	for Index,Value in pairs(character:GetDescendants()) do 
		if not Value:IsA('BasePart') then continue end
		Transparency[Value] = Value.Transparency
		Value.Transparency = 1	
	end
	
	wait(duration)
	
	for i,v in pairs(Transparency) do 
		i.Transparency = v
	end
	for i, v in pairs(delete) do
		v:Destroy()
		delete[i] = nil
	end
	wait(cooldown)
	debounce[Player] = nil
end)