Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would you award a playerpoint per level-up?

I am looking for a script that checks is Value A has gone up one and then gives the player a Playerpoint. Here is an example of the script.

local PointsService = Game:GetService("PointsService")
local pointsToAward = PointsService:GetAwardablePoints()

	if ( pointsToAward > 0) then
		level.Value = level.Value + 1
			pcall(function()
			PointsService:AwardPoints(p.userId,1)

end

Yeah, I'm a basic scripter but I just need someone to put that all together.

Thanks!

  • Michael

5 comments

0

Why don't you reward the PlayerPoint at the point in your script where you change the value?

0

Again, basic scripter. I have no idea.

0

Then why do you need a script to check if a value changes, if you don't have a script that changes the value? I'd start creating that first.

0

I do... The value changes on the Leaderboards... What I was hoping for was that the example above was a basis on what I needed as again, A BASIC SCRIPTER.

0

Ah, now I get it. I've posted an answer.

1 answer

In a LocalScript put:

local player = game.Players.LocalPlayer
local PointsService = Game:GetService("PointsService")
local pointsToAward = PointsService:GetAwardablePoints()

player.leaderstats.level.Changed:connect(function(v) -- Checks if the value is changed
	if pointsToAward > 0 then
        PointsService:AwardPoints(player.userId,1)
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.