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

Help with Player Points ?

Asked by 11 years ago

How do i make a kill system with player points in my sword fighting game?

Like 1 kill = 1 player point? been stuck with this for hours now! please help!

does this work?

01local PointsService = Game:GetService('PointsService')
02 
03_G.GivePlayerPoints = function(player, points)
04    if player and points then
05        points = math.floor(points)
06        local success, errorText = pcall(function()
07            local pointsAvailable = PointsService:GetAwardablePoints()
08            local pointsToAward = math.min(points, pointsAvailable)
09            _G.print(script.Name, "Awarding:", pointsToAward, "Total available:", pointsAvailable)
10            PointsService:AwardPoints(player.userId, pointsToAward)
11            _G.print(script.Name, "Done.\n")
12        end)
13        if not success then
14            _G.print(script.Name, "FAILURE! ErrorMsg:", errorText)
15        end
16    end
17end

2 answers

Log in to vote
0
Answered by
mruno 20
11 years ago

Hey there, this wiki page might be helpful: http://wiki.roblox.com/index.php?title=Points_Tutorial

As explained in the above link, a game will have a pool of points to give out. One point is generated in that pool per 1 robux spent in your game. (You can only give out points if someone has bought something like a game pass in your game)

Once you are clear with that, the functions you need are in the page I linked. Good luck!

EDIT: You added code while I was typing my post :P I'm not sure if that will work. Once you have some points to give out you can test it though.

Ad
Log in to vote
-1
Answered by 11 years ago

CLOSED

0
Sorry Loriese 0 — 11y

Answer this question