local DataStoreService = game:GetService("DataStoreService") local MyDataStore = DataStoreService:GetDataStore("MyDataStore")
game.Players.PlayerAdded:Connect(function(Player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = Player
local Points = Instance.new("IntValue")
Points.Name = "Points"
Points.Parent = leaderstats
local playerUserId = "Player_"..player.UserId
--load
local data
local succes, errormessage = pcall(function()
data = MyDataStore:GetAsync(playerUserId)
end)
if succes then
Points.Value = data
--set our data to equal points
end
end) after the local playeruserid there is player.userid that player is in a blue line when i play it its saying this ServerScriptService.server script:13: attempt to index nil with 'UserId' - Server - server script:13

2 comments
"it's thedevking not hedevking lol" i completely agree
thanks for answering and i have another doubt which you ca see