I'm trying to make a script that makes a player's hrp's up-down rotation move accordingly with the camera (shiftlock is mandatory already) and this is what I've come up with, but i want to make the up-down rotation be limited to a certain rotation, let's say 30 degrees
local plr = game.Players.LocalPlayer
local cam = workspace.CurrentCamera
game.RunService.Heartbeat:Connect(function()
plr.Character.HumanoidRootPart.CFrame = cam.CFrame.Rotation + plr.Character.HumanoidRootPart.Position
end)