Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would you award a playerpoint per level-up?

Asked by 10 years ago

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
0
Why don't you reward the PlayerPoint at the point in your script where you change the value? damagex443 325 — 10y
0
Again, basic scripter. I have no idea. Michael007800 144 — 10y
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. damagex443 325 — 10y
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. Michael007800 144 — 10y
0
Ah, now I get it. I've posted an answer. damagex443 325 — 10y

1 answer

Log in to vote
-1
Answered by 10 years ago

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)
Ad

Answer this question