Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to access leaderstats from outer the player joined codeblock?

Asked by 4 years ago

I have been thinking how to access leaderstats of a player from another codeblock but in the same script. I tried many ways and eventually got nothing. I really do need help with this as I am not a very professional scripter.

1 answer

Log in to vote
2
Answered by 4 years ago
Game.Players[playername].leaderstats
0
game should be with a lowercase sorry Barty200 85 — 4y
0
I think you can edit your answer. baldi92102 2 — 4y
0
I keep getting an error with bad argument #2 (string expected, got nil). Can you please explain how this works? DangerousKillerTimur 54 — 4y
0
Make sure it's the playername your putting in the square brackets. If you have the path to a player like player = game.Players.LocalPlayer or something similar then just use player.leaderstats Barty200 85 — 4y
View all comments (2 more)
0
I get this error: attempt to index nil with 'leaderstats'. DangerousKillerTimur 54 — 4y
0
Have you created a leaderstats folder inside of the player when they join? Barty200 85 — 4y
Ad

Answer this question