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

How can I add a player points system to my game? [closed]

Asked by 11 years ago

I tried to make it with the local scripting way,doesn't work..

0
This isn't a Q&A site where we do it all for you. Shawnyg 4330 — 11y

Closed as Not Constructive by AmericanStripes

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
1
Answered by 11 years ago

You should make it in a script not localscript:

01-- declare service
02local PointsService = Game:GetService("PointsService")
03 
04-- Bind function to player added event
05game.Players.PlayerAdded:connect(function(player)
06    -- Get total number of points the game has available
07    local pointsToAward = PointsService:GetAwardablePoints()
08    -- Get total number of points this game has already awarded to the player
09    local universeBalance = PointsService:GetGamePointBalance(player.userId)
10    -- Check if the game has points to award and if the player hasn't gotten any points yet. If both are true, then give the player a point.
11    if ( pointsToAward > 0 and universeBalance == 0) then
12        PointsService:AwardPoints(player.userId, 1)
13    end
14end)
15 
View all 23 lines...

also Thank the roblox wiki.

0
Thanks for the advice robloxking740 0 — 11y
0
Np digitalzer3 123 — 11y
0
Also accept answer if it helped. digitalzer3 123 — 11y
0
v just copied me. digitalzer3 123 — 11y
Ad
Log in to vote
0
Answered by 11 years ago
01You should make it in a script not localscript:
02 
03view source
04 
05-- declare service
06 
07local PointsService = Game:GetService("PointsService")
08 
09 
10 
11-- Bind function to player added event
12 
13game.Players.PlayerAdded:connect(function(player)
14 
15    -- Get total number of points the game has available
View all 49 lines...