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

How do I make a script which you get player points when you join the game? [closed]

Asked by 10 years ago

I need help finding and making the script.

Closed as Not Constructive by User#2

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
Vividex 162
10 years ago

This is NOT a request site.

Ad
Log in to vote
0
Answered by
Mauvn 100
10 years ago

This is the script it will work if you have playerpoint's left in the server.

Source: Roblox Wiki (Maybe you should check that instead of us giving you the answers and you doing no effort!)

Click here to see the link

-- First declare the  service
local PointsService = Game:GetService("PointsService")

-- Bind function to player added event
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, 1) -- Change this to how many points you want them to earn!
        end)
    end
end)

-- Bind function to when points are successfully awarded
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)

If this helped,

1 up me!