How to make the player stay in the position where the animation finished

hello so i am making an animation where it moves the player pretty far away but the problem is that when the animation ends the player goes back to the position where he was before the animation player how do i make it so when the animation ends the player stays in the position where he during the animation?

i saw this question on scripting helpers but i cant open the site

Just tp the player to the ending position when the animation ends

player.HumanoidRootPart.CFrame = endingPart.CFrame

not really working because the timing isnt well it either teleports him to late or too early

Maybe add an animation event at the end. When it’s reached, teleport the character to the desired location.

i cant use events since its a global scripts that runs a RemoteEvent to fire the animation and i cant change that since its meant to be reusable meaning that i can dublicate the model without changing the locals if you get me

Can you paste the animation event script here, it may be easier to think and understand

ok
Local script that holds the RemoteEvent

Anim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(game.ReplicatedStorage.Animation)

Climb = game.ReplicatedStorage.Climb

player = game.Players.LocalPlayer

Climb.OnClientEvent:Connect(function()

Anim:Play()

end)

the global one
Players = game.Players
StartPos = script.Parent.Parent.Parent.StartPos
script.Parent.Triggered:Connect(function(Player)

print(Player)
	
game.ReplicatedStorage.Climb:FireClient(Player)
wait(1.3)
Player.Character.HumanoidRootPart.CFrame = StartPos.CFrame

end)

animation lenght is 1.06

everything should be reusable without having to change lines when you dublicate the object, its a window and you go trought it

everything is fixed i altered the animation and used vectors to push it