Help changing script to match ScreenGUI

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.

Screen Shot 2021-07-31 at 11.12.08 PM

Screen Shot 2021-07-31 at 11.11.19 PM

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.

You can use player.leaderstats.Points.Value to get the amount of points from a player and implement it in your custom player list. Also, if you want it to update when player points change, you can use Instance | Roblox Creator Documentation

I’m a little confused. If I use player.leaderstats.point.value, what exactly do I change to implement it into my custom GUI?

You have to add that in your custom player list. Because roblox just adds that in the default player list.

this

How do I add that to the custom list though. Do you mean I have to add the script inside the custom GUI?

No, I don’t mean the script. I mean you have to add somewhere a text label with the points so that you can change the text to the player’s points. Just like roblox’s default player list.

Once I add the textlabel, what else to I need to add to actually make it function?

You have to add what I said above in your code in your custom player list.

Ohh i see i see.

Now do I need the entire code,

or just the player.leaderstats.points.value snippet that contains a few lines (ie: the spawn(function() part.

You can add something like this:

local player = game.Players.LocalPlayer
local Points = script.Parent
local leaderstats = player.leaderstats

leaderstats.Points:GetPropertyChangedSignal("Value"):Connect(function()
	Points.Text = leaderstats.Points.Value
end)

This should be within your gui

Hmmm doesn’t work.

I’m not sure what is going wrong either.