Hello, so i'm trying to load value from ReplicatedStorage into a normal leaderboard, but it just keep saying "ServerScriptService.LinkedLeaderboard:138: attempt to index a nil value".
Problem is in these lines:(Original lines)
local PlayerStats = game.ReplicatedStorage.PlayerStorage.Store:FindFirstChild(newPlayer.Name).PointsStorage
if PlayerStats ~= nil then
if cash then
local Short = Settings.LeaderboardSettings.ShowShortCurrency
PlayerStats.Changed:connect(function()
if (Short) then
cash.Value = Settings:ConvertShort(PlayerStats.Value)
else
cash.Value = Settings:ConvertComma(PlayerStats.Value)
end
end)
end
end
Even i tried to separate PointsStorage from it and add new line with it.
Here is changed a bit script:
local PlayerStats = game.ReplicatedStorage.PlayerStorage.Store:FindFirstChild(newPlayer.Name)
if PlayerStats ~= nil then
local plrStats = PlayerStats:FindFirstChild("PointsStorage")
if plrStats ~= nil then
if cash then
local Short = Settings.LeaderboardSettings.ShowShortCurrency
plrStats.Changed:connect(function()
if (Short) then
cash.Value = Settings:ConvertShort(plrStats.Value)
else
cash.Value = Settings:ConvertComma(plrStats.Value)
end
end)
end
end
end
Error dissapeared, but script still don't work..

2 comments
Can you give us the full error message, or tell us which of the above lines is line 138?
Line 138 is the first line(01) in this part of the script which i typed here. I can paste here full script, but it's long script.