So I am using --!strict in all of my scripts because I want to have type hinting in my scripts.
Today I opened a localScript and tried accessing game.Players.LocalPlayer.<something>
and I got the errorType Error: Value of type 'Player?' could be nil.
Now I am aware that this can happen on a serverScript, but why do I get this error on localScripts? LocalPlayer should never be nil in this case
Is there an elegant way to deal with this in localScripts? Right now I am checking every time if the LocalPlayer is nil and otherwise throwing an error (which again, should never happen), but this seems really annoying to do every time.
Thank you!