Dash became teleport for other players

Hello guys ^^

I’m trying to have movement skills like a dash, and I though I was on the right track with :

        -- server side
	local direction = player.Character.HumanoidRootPart.CFrame.lookVector * 50
	local oldSpeed = player.Character.Humanoid.WalkSpeed
	player.Character.Humanoid.WalkSpeed = 0

	local velocity = Instance.new("LinearVelocity")
	velocity.Attachment0 = player.Character.HumanoidRootPart.RootAttachment
	velocity.VectorVelocity = direction
	velocity.ForceLimitsEnabled = false
	velocity.Parent = player.Character.HumanoidRootPart
	
	player.Character.Humanoid.WalkSpeed = 0
	wait(0.2)
	velocity.VectorVelocity = Vector3.zero
	velocity:Remove()
	player.Character.Humanoid.WalkSpeed = oldSpeed

This way there is no lag between the server accepting the skill use and the movement. But the current result is that other players don’t see the movement. The dashing chracter just pop at the end.

How do you handle those things properly ?
Thanks !

I would recommend you to perform the movements of your player’s character on the client side, as it replicates to all players. Just be careful not to introduce any flaws that could give advantages to exploiters.

If you want an extra layer of security, trigger an event to inform the server that the player is performing a dash or any other type of movement.

Basically the only choice is to keep the movement on player side and try to track everything to see if they do anything fun ? That’s a lot of code to resolve a roblox problem :frowning:

I guess that’s the standard, but that’s really bothering me. I’ll try a few things before to give up.

Thanks ^^

So in fact the code above works, it’s just that I failed to setup the network owner properly…

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.