I have a problem in my game with leaderstats Value

Only This script:

local DataStore = game:GetService("DataStoreService")
local MyData = DataStore:GetDataStore("leaderstats")

game.Players.PlayerAdded:Connect(function(player)
	local Folder = Instance.new("Folder")
	Folder.Parent = player
	Folder.Name = "leaderstats"

	local Points = Instance.new("IntValue")
	Points.Name = "Points"
	Points.Parent = Folder
	Points.Value = MyData:GetAsync("stat1-"..player.UserId)
end)

game.Players.PlayerRemoving:Connect(function(player)
	local Data1 = player.leaderstats.Points.Value
	MyData:SetAsync("stat1-"..player.UserId, Data1)
end)

[/quote]

1 Like

Thanks so much for the feedback and the support

No problem I like to help! :grinning: :grinning:

You need to name the folder containing stats “leaderstats” any other name will result in the in-game leaderboard not being utilised.

More info here:

yes I already did it, but Thanks for supporting