Cursor.lockState = CursorLockMode.None; wont work in build

This code is used when I change scenes it works perfect in the editor but in the build, it stays locked how do I fix this?

The editor allows to escape the mouse to change things in the scene no matter what your code said.
So I guess your mouse cursor is unlocked but still invisible. Cursor.lockStatedoesn’t change the visibility of the cursor.
Try adding Cursor.visible = true; after your lockState change. and the cursor should be visible and unlocked in your build too.