Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to access leaderstats from outer the player joined codeblock?

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

Game.Players[playername].leaderstats

6 comments

0

game should be with a lowercase sorry

0

I think you can edit your answer.

0

I keep getting an error with bad argument #2 (string expected, got nil). Can you please explain how this works?

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

0

I get this error: attempt to index nil with 'leaderstats'.

0

Have you created a leaderstats folder inside of the player when they join?

This discussion is preserved as it was. New answers, comments, and votes are closed.