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

How do I access every players leaderstats in the game?

Asked by 2 years ago

So I made a leaderstats script and I want to access it into another script is this possible here is my code.

1game.Players.PlayerAdded:Connect(function(plr)
2    local ls = Instance.new("Folder")
3    ls.Parent = plr
4    ls.Name = "leaderstats"
5    local Levels = Instance.new("IntValue")
6    Levels.Parent = ls
7    Levels.Name = "Levels"
8    Levels.Value = 0
9end)

1 answer

Log in to vote
0
Answered by 2 years ago

In other script refer to it as a leaderstats for example:

1Player:FindFirstChild("leaderstats")
Ad

Answer this question