so ive been trying to make a little bit of a dash attack, and all hell breaks loose after it teleports, both to the client and the server. it almost looks like the enemy hinges to the player from like 100 studs away to the server and to the client it looks like its running on by.
script: (most relevant part)
local function dash()
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://16173725548"
local animtrack = ShirouHum:LoadAnimation(animation)
animtrack:Play()
task.spawn(function()
wait(0.7)
local player,distance = GetNearestPlayer()
if player then
createCloneEfffect()
ShirouHRP.CFrame = CFrame.lookAt(ShirouHRP.Position,player.Character.HumanoidRootPart.Position)
ShirouHRP.Anchored = true
ShirouHum.EvaluateStateMachine = false
wait(0.3)
ShirouHRP.Position += ShirouHRP.CFrame.LookVector*distance
ShirouHRP.Anchored = false
ShirouHum.EvaluateStateMachine = true
end
end)
end
edit: wrong clip (fixed)