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

Adding player points to a game?

Asked by 10 years ago

I don't know how to do this, but is there anyone who can tell me how to do it?

3 answers

Log in to vote
0
Answered by 10 years ago

Here is a wiki article

Points Tutorial

Here is a script that will award points every second a player is in the server

points=Game:GetService("PointsService")

local award= PointsService:GetAwardablePoints()

game.Players.PlayerAdded:connect(function(plr)
while true do
wait()
if award>0 then
points(plr.userId, 1)
end
end
end)

I wrote that script off the top of my head, if it doesn't work, comment and I will fix it asap.

Ad
Log in to vote
0
Answered by 10 years ago

Firstly ROBLOX has a point tutorial on their wiki! Player Point Tutorial You must understand what player points need to have before you can obtain any player points and/or give them out!

Player points need something bought on your game (gamepass or developer products) Another thing to not is that 1 robux = 30 playerpoints Okay! Now for player points to also work, you need a game that uses player points for a reason. If you don't have one, then the player points on your game won't be very useful! If you want it to give you player points when you join, but only once, then this localscript may come in handy:

local PointsService = Game:GetService("PointsService")
game.Players.PlayerAdded:connect(function(player)
    local pointsToAward = PointsService:GetAwardablePoints()
    local universeBalance = PointsService:GetGamePointBalance(player.userId)
    if ( pointsToAward > 0 and universeBalance == 0) then
    pcall(function()
            PointsService:AwardPoints(player.userId, 10)
        end)
    end
end)
PointsService.PointsAwarded:connect(function(userId, userBalanceinUni, userBalance)
    -- Show message indicating that a player has gotten points
    local message = Instance.new('Message', game.Workspace)
    message.Text = "Point awarded to " .. userId .. ". This player now has " .. userBalance .. " points total!"
    wait(5)
    message:Destroy()
end)

Yes. I do give credit to wiki.roblox.com for this script.

Log in to vote
0
Answered by 10 years ago

If you want to add play points to your game i would suggest going here: https://www.youtube.com/watch?v=gDA0jJP-nww its a how to video on how to put plaer points in your game.

Answer this question