there a few different was to do this but you might try something like this it will keep the original cframe rotation and then set it to the current x and z position but at the 5 mark on Y evertime
local HRPCFrame = character.HumanoidRootPart.CFrame -- just get base cframe
local Rotation = HRPCFrame - HRPCFrame.Position -- this removes the position from cframe leaving only a rotated cframe
local NewCFrame = Rotation + Vector3.new(HRPCFrame.X, 5, HRPCFrame.Z) -- this adds back the new position set at Y 5