Hello. I've seen many games locking the player's mouse, but I don't know how. Like they enable shift lock to the player without him pressing left shift. I would absolutely accept the helpful answer!
https://developer.roblox.com/en-us/api-reference/property/UserInputService/MouseBehavior
local UserInputService = game:GetService("UserInputService") UserInputService.MouseBehavior = Enum.MouseBehavior.LockCurrentPosition -- or LockCenter or Default
Default: The mouse moves freely around the user’s screen.
LockCenter: The mouse is locked, and cannot move from, the center of the user’s screen.
LockCurrentPosition: The mouse is locked, and cannot move from, it’s current position on the user’s screen at the time of locking.