Retiring PointsService

Is there still any way to use :GetPointBalance()? I want to create a quick project before the PointsService retires but I need this function to work. Currently it only returns 0

1 Like

We will always remember this future back when points were supported.
Fly high. PointsService.

2 Likes

You will be missed PointsService :wave:

image

5 Likes

No, itā€™s an artifact from back when points were a cross-game concept, with each game having a limited amount of points to award.

4 Likes

Just wanted to add that it really wouldnā€™t be hard to make a direct copy of pointsservice in the first place, all you need to do is fire the notification API with the same image and text.

4 Likes

I was thinking of emulating the old PlayerPoints popup with StarterGui:SetCore(). But I canā€™t find the red Player Points star icon in the game files, anyone know where to find it in the texture files?

2 Likes

I believe he is making a joke, but I am not sure.

From checking the 2014-2017 clients and the 2013 RCC files, I cannot find it. Perhaps it is an online asset.

2 Likes

is this a save thing or what? man i should learn some code things

itā€™s an uploaded asset: rbxassetid://206410433

11 Likes

it was a per game and full platform leaderboard system, game owners could call it to then give a user points to be displayed on both, they were a way of showing how much you played and how good you are at that game.

1 Like

but the devs wont be able to have a custom leaderboard page on their games, or let users show off their points in diff games. like i said, so many ideas, that roblox decided to throw away

1 Like

Though it is nostalgic Iā€™m glad Roblox is continuing to take steps to improve the platform. I think finally sunsetting PointsService was the right call due to the alternatives available now. Iā€™m glad that Roblox staff are offering easy ways to try and retain functionality for legacy code bases and offering data transfer. This is exactly how feature sunsets should work!

3 Likes

To the 7 people who got mad at this person for saying this, I hope you now realize that this is satire. Itā€™s a bait comment, and you guys fell for it.


I use PointsService for my game, but it wonā€™t be hard to migrate. Thanks for providing a module for us! Thatā€™s very considerate.

5 Likes

I feel like this is a good idea, PointsService is deprecated, and I want to make roblox games future proof, and Iā€™m helping to achieve that by making a plugin

the module you provided is better if itā€™s like this,

-- change the datastore name as desired
local datastoreName = "_rbx_UserPoints"
local pointsAwarded = Instance.new("BindableEvent")

local ds = game:GetService("DataStoreService"):GetOrderedDataStore(datastoreName)
local ps = game:GetService("PointsService")

local PointsServiceWrapper = {}

function PointsServiceWrapper:AwardPoints(userId: number, amount: number)
	if userId <= 0 then
		error('User id must be positive')
	end
	if amount <= 0 then
		error('Point amount must be positive')
	end

	-- optimistically assume that the user has already been migrated
	local finalPoints = ds:UpdateAsync(userId, function (currentPoints: number?): number?
		if not currentPoints then
			-- oops, not actually migrated
			return nil
		end
		return currentPoints + amount
	end)

	if not finalPoints then
		-- this user has not been migrated, migrate it now
		local legacyPoints = ps:GetGamePointBalance(userId)

		finalPoints = ds:UpdateAsync(userId, function (currentPoints: number?): number
			if not currentPoints then
				-- still not migrated, add point amount from the legacy system
				-- to the amount of points awarded
				return legacyPoints + amount
			else
				-- the user must have been migrated from another instance;
				-- disregard legacy points and proceed as usual
				return currentPoints + amount
			end
		end)
	end

	if finalPoints then
		pointsAwarded:Fire(userId, amount, finalPoints, finalPoints)
	end
end

function PointsServiceWrapper:GetGamePointBalance(userId: number): number
	if userId <= 0 then
		error('User id must be positive')
	end

	-- optimistically assume the user has been migrated
	local points = ds:GetAsync(userId)
	if not points then
		-- user not migrated yet, query legacy system
		points = ps:GetGamePointBalance(userId)
	end

	return points
end

function PointsServiceWrapper:GetPointBalance(userId: number): number
	return 0
end

function PointsServiceWrapper:GetAwardablePoints(): number
	return 2^31 - 1
end

PointsServiceWrapper.PointsAwarded = pointsAwarded.Event

return PointsServiceWrapper

though you might have to fill the form in qualtrics in order to get your experience to migrate data, I donā€™t feel interested to use the qualtrics surveies, as it first asks for my age, and I donā€™t like sharing my age

As silly as it sounds, PointsService actually taught me the value of refactoring code (or, at least, the find and replace feature) - I had added it in as an extra thing (for the leaderboards feature) of several existing games of mine from 2013-2015 that all happened to have ā€œPointsā€ as the name of the in-game currency, and the ensuing player confusion lead to me renaming said currency to ā€œMoneyā€ wherever I couldā€¦ I guess with the API being retired I could change it back, but at this point thereā€™s bigger issues regarding functionality of games that old anyways.

1 Like

If anyone wants to see the player points in use, hereā€™s a game that still uses it:

5 Likes

I feel like this update shouldnā€™t be rolled out to certain games that havenā€™t been updated within a certain period of time to prevent old games that donā€™t receive updates anymore relying on this functionality from breaking.

Itā€™s already likely that those kind of games are broken from previous updates

Do I have to fill out a form for every game that I need PointsService for?