I’m creating a point system in-game. It displays properly with the normal playerlist in-game, but when I turn on the custom player list I made using a ScreenGUI it disappears. I know this is because the script for the point system is dedicated to the original playerlist, however, I can’t figure out how to switch it to work with the custom playlist I made instead.
Below is photos of the original playerlist with the points displayed, the custom playerlist without it displayed, and my full script.


local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local DataStoreService = game:GetService("DataStoreService")
local MarketplaceService = game:GetService("MarketplaceService")
local PlayerData = DataStoreService:GetDataStore("PlayerData")
local GamepassID = 20574218
Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder", player)
leaderstats.Name = "leaderstats"
local Points = Instance.new("IntValue", leaderstats)
Points.Name = "Points"
local success, data = pcall(function()
return PlayerData:GetAsync(player.UserId)
end)
if success and data then
Points.Value = data.Points
elseif not success then
warn("There was an error loading the player data")
end
end)
spawn(function()
while wait(1) do
for _, player in pairs(Players:GetPlayers()) do
local success, result = pcall(MarketplaceService.UserOwnsGamePassAsync, MarketplaceService, player.UserId, GamepassID)
if success and result then
player.leaderstats.Points.Value += 2
elseif success and not result then
player.leaderstats.Points.Value += 1
elseif not success then
warn("An error occurred when checking if the player owns the gamepass")
end
end
end
end)
Players.PlayerRemoving:Connect(function(player)
local data = {
Points = player.leaderstats.Points.Value
}
local success, err = pcall(function()
PlayerData:UpdateAsync(player.UserId, function(oldData)
return data
end)
end)
if not success then
warn(err)
end
end)
game:BindToClose(function()
if RunService:IsStudio() then
return
end
for _, player in pairs(Players:GetPlayers()) do
local data = {
Points = player.leaderstats.Points.Value
}
local success, err = pcall(function()
PlayerData:UpdateAsync(player.UserId, function(oldData)
return data
end)
end)
if not success then
warn(err)
end
end
end)
Credits to @Axel_c for the scripting help.
