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

How do I reference a leaderstat value?

Hello, i am trying to pull a leaderstat value so i can use a math operation.

1 comment

0

leaderstats are in the player so local value = game.Players.PLAYERS_NAME_GOES_HERE.leaderstats.VALUE_YOURE_TRYING_TO_GET.Value

1 answer

✓ Accepted answer

Simple in serverscriptservice

game.Players.PlayerAdded:Connect(function(plr)
	local folder = Instance.new("Folder")
	folder.Name = "leaderstats"
end)

You need that script to make a leader stat folder if u haven't already

--localscript
plr = game.Players.LocalPlayer
**folder = plr:WaitForChild("leaderstats")**

1 comment

0

Thank you so much! I was being stupid and just couldnt figure it out

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