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

leaderstats is not a valid member of Player SIMPLE???

HI I HAVE A gui In wich the player coins are shown and inside the gui i have a local script like this Local script :

local player=game.Players.LocalPlayer
local curr="Crafts"
script.Parent.Text=player.leaderstats[curr].Value

but this doesn't work it gives me leaderstats is not a valid member of Player

2 answers

✓ Accepted answer
local player = game.Players.LocalPlayer
local curr ="Crafts"
repeat wait() until
	player.leaderstats[curr].Value
end
script.Parent.Text = player.leaderstats[curr].Value

This will wait until "Crafts" has loaded, resuming the code.

~ Dan_PanMan, advanced scripter.

2 comments

0

thank you this worked Should i just make a while loop to the whole code to change it when their coin values have changed

0

no you dont have to use a while loop. if it worked, please accept the answer

try this:

local player=game.Players.LocalPlayer.Character
local curr="Crafts"
script.Parent.Text=player.leaderstats[curr].Value

1 comment

0

You should use WaitForChild() as well.

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