What I want this script to do is to move forward every time it slides Example : npc -> wall -> at destination move->slide->come here But what it really does is this: move->slide->at destination -> goes back to beginning Plus what is weird is how my animation always glitches
local anim = script.SlideAnimation
local mouse = game.Players.LocalPlayer:GetMouse()
local hum = game.Players.LocalPlayer.Character.Humanoid
mouse.KeyDown:Connect(function(key) -- I know its depricated
if key == "l" or key == "L" then
local anima = hum:LoadAnimation(anim)
hum.WalkSpeed = 0
hum.JumpPower = 0
anima:Play()
wait(2.2)
hum.Parent.Torso.CFrame = CFrame.new(0 , 0 , 0 + -5) -- Am I doing this correct??
hum.WalkSpeed = 16
hum.JumpPower = 50
end
end)
Hopefully people who see this can answer

2 comments
Use the humanoid and moveto()
ok thanks