A lot of scripts in my place have worked completely fine for the past few months, both in studio and in-game.
I’ve recently started getting this error in studio when launching a test server:
Does anyone know what it’s caused by? All I’m referencing at that source is the LocalPlayer in a LocalScript.
1 Like
Letink
(Letink)
July 21, 2018, 9:56pm
#2
Do you have a:
repeat wait(0.1) until game.Players.LocalPlayer
or something similar, as it may be calling before the player exists yet.
I’ve had one, yes. That’s why it’s odd to me that it’s deciding to break now.
Letink
(Letink)
July 21, 2018, 9:59pm
#4
Yeah, it is very odd. Only other thing I can think of is if you changed something else which broke it.
I didn’t change anything , the only thing I can think of is using UserHasBadgeAsync.
Is there any chance they changed it?
Letink
(Letink)
July 21, 2018, 10:01pm
#6
Is that serverside? I don’t think you can call that from LocalScript, but I could be wrong.
Off-topic but FYI, Players.LocalPlayer is guaranteed to be defined client-side, you don’t need to wait for it to exist.
1 Like
It is server-side, I use RemoteEvents and RemoteFunctions to relay the relevant info back to the client.
Do you think it’s possible the negative/0 PlayerIds of test players could be the issue?
I think I figured it out.
UserId 0 is what’s throwing the “user does not exist” error. All the negative ID users are fine.
Was this changed in studio somehow? I don’t remember the test users starting at 0 in the past, and they would start at -1. Because this might actually be a bug then.
Letink
(Letink)
July 21, 2018, 10:12pm
#13
I see, you’re probably right. Test player ID does start at zero though.
1 Like
Maybe, I guess I just don’t see why it’d start acting up now after a year of no change.
1 Like
Letink
(Letink)
July 21, 2018, 10:14pm
#15
Yeah, that is quite strange.