Hey guys, so I've obviously looked at the wiki page here but I can't seem to understand how to use data stores to get character information, or store it.
I have the following code:
local levelManagement = Instance.new("Smoke", game.ServerStorage)
levelManagement.Name = "LevelStorage"
game.Players.PlayerAdded:connect(function(player)
local levelStorage = Instance.new("NumberValue", game.ServerStorage.LevelStorage)
levelStorage.Name = player.Name
levelStorage.Value = 1
local leaderboard = Instance.new("IntValue")
leaderboard.Name = "leaderstats"
leaderboard.Parent = player
local level = Instance.new("IntValue")
level.Name = "Level"
level.Parent = leaderboard
level.Value = levelStorage.Value
end)
game.Players.PlayerRemoving:connect(function(player)
local levelStorage = game.ServerStorage.LevelStorage:FindFirstChild(player.Name)
if (levelStorage) then
levelStorage:Destroy()
end
end)
I'm trying to get the "levelStorage.Value" to get data from previously saved information. I'm also trying to have it save information after the person leaves.
I'm not looking for a handout, as I want to learn more than just have someone else finish my work for me. Just point me in the right direction, please?

1 comment
Wiki seems to explain it good enough.