LocalPlayer Timing Update

Hi All!

Today, we have enabled a minor change that will delay the creation of LocalPlayer in preparation for another feature. LocalScript will still run after LocalPlayer can be detected, so this will not affect any LocalScripts in your games and should only affect Roblox’s CoreScripts.

What does that mean for you?

  • Nothing! This change should be completely transparent to you. There is no need to change any localscripts or how you detect Localplayer.
  • The timing is delayed from before establishing a connection to the game server to after. Please note that this will not affect anything in the FirstReplicated section or any localScripts. LocalScripts are still replicated and ran after LocalPlayer is completely set up, same as before.

We expect this change to be seamless, but if you come across any problems or have any issues/concerns, feel free to post here so we can look into it!

Edit: LocalScripts should be detecting game.Players.LocalPlayer without issues when it starts. If LocalPlayer is nil when a localScript starts, it would present an issue - please report this case.

Edit 2: Reedited content above to clarify that this change should not impact/change games in any way, that we would like to gather feedback if developers observed any different behavior resulting from this change.

Have a great day!

15 Likes

Would this feature have anything to do with custom load screens and player gui :thinking:

4 Likes

Does this mean that I could have LocalScripts executing before LocalPlayer is set? Because if so, then this will effectively break every client-side codebase I have in all my games.

Edit: @KnightTakami clarified that this won’t be an issue in a following reply below

18 Likes

Yep same here, weird stuff.

What is exactly happening? Will my scripts yield when I access LocalPlayer or will LocalPlayer be nil on game start for a while?

1 Like

Wait what?

No warning? This just shipped? Localplayer not necessarily being available as it was previously? This needs more warning :eyes:

Time to go emergency test…

Edit: Original post was fixed, originally claimed a very dangerous change was shipped.

10 Likes

What? This was never announced? This can easily break games. It should have been announced before being turned on.

I guess I’ll be spending the next hour testing all my games to make sure they aren’t broken

8 Likes

Why can’t we just have a function(or proprety) for whether the client has loaded or not?

1 Like

Your games should be just fine. LocalPlayer is still guaranteed to be non-nil in all of your scripts, including those running in ReplicatedFirst.

I will probably have to revisit the PlayerGui change though. But it should be even easier now!

8 Likes

This just makes the post even more confusing. The OP says LocalPlayer might be nil because the timing changed, you say it can’t be nil. What is the actual effect of this change?

1 Like

Hi All,

Sorry for the confusion. To clarify: This change should not affect the ability to detect LocalPlayer in any local scripts. It will affects the Corescripts. There should be no need to modify localscripts. Custom loading screens and playerGuis should not be affected by this change.

18 Likes

Awesome, thanks for the clarification!

So I was right :thinking:

The real question here is, what’s the upcoming feature? :thinking:

2 Likes