why is there an erroe here i saw hedevking video and not coming?
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
01 | local Points = Instance.new( "IntValue" ) |
03 | Points.Parent = leaderstats |
05 | local playerUserId = "Player_" ..player.UserId |
09 | local succes, errormessage = pcall ( function () |
10 | data = MyDataStore:GetAsync(playerUserId) |
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