found this youtube video on datastores and wanted to try it out but for some reason it doesnt load in the level value(and it wont display the level value either)
local DataStoreService = game:GetService("DataStoreService")
local LevelSave = DataStoreService:GetDataStore("PLevel")
local LevelLable = game.StarterGui.TopLeftGui.LevelGui.LevelLabel
game.Players.PlayerAdded:Connect(function(plr)
local Level = Instance.new("IntValue")
Level.Name = "Level"
Level.Parent = plr
LevelLable.Text = "Level:"..Level.Value
local success, errormessage = pcall(function()
LevelSave:GetAsync(plr.UserId, plr.Level.Value)
end)
if success then
print("cool")
else
print("there was an error whilst printing your data")
warn(errormessage)
end
end)
game.Players.PlayerRemoving:Connect(function(plr)
local success, errormessage = pcall(function()
LevelSave:SetAsync(plr.UserId, plr.Level.Value)
end)
if success then
print("yes")
else
print("no")
warn(errormessage)
end
end)

2 comments
I do not know how your leaderstats work but I do not see anywhere you setting Level.Value to data you got from datastore.
how would I do that?