local player = require("player") local keys = require("keys") local hold = false local needSync = false registerKeyEvent(function(key, action) if key == keys.KEY_LEFT_ALT then if action == "Press" then hold = true needSync = false elseif action == "Release" then hold = false needSync = true end end end) registerClientTick(function() if hold then local rot = player.getSilentRotation() player.setSilentRotation(rot.yaw, rot.pitch) elseif needSync then local rot = player.getSilentRotation() player.setRotation(rot.yaw, rot.pitch) player.setSilentRotation(rot.yaw, rot.pitch) needSync = false end end)