✓ Accepted answer
Normal "Script" objects are run by the server; that means it doesn't have a notion of one particular player being "special", so it can't pick the LocalPlayer.
In Test Solo, Scripts will identify the LocalPlayer -- it's unambiguous, since there can only be one. I think this is done so that there is not a need to simulate two separate copies of the world when testing.
Running with a Test Server will actually separate the behavior of LocalScripts from normal Scripts.
Summary No, you can't: LocalPlayer should only be used in LocalScripts -- otherwise it will be nil (except when testing, so be careful).
2 comments
'LocalPlayer' is no longer supported on a Server-Sided script, only to a Client-Sided script is it supported now.
Thanks @TheAlphaStigma, I had some issues with it in Studio Test Mode. "LocalPlayer" WAS working in Studio Test Mode, probably because it's classified as "Play Solo."