Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Awardable player points?

How do I add awardable player points to a brand new game i created for people to start of with?

2 answers

To award playerpoints to a player after killing someone, use this.

print("Currently awardable points : "..game.PointsService:GetAwardablePoints())
game.Players.PlayerAdded:connect(function(plr) 
plr:WaitForChild("leaderstats") 
ks = plr.leaderstats:WaitForChild("Kills") 
local last = ks.Value ks.Changed:connect(function() 
if ks.Value > last then
print("Currently awardable points : "..game.PointsService:GetAwardablePoints())
if game.PointsService:GetAwardablePoints() > 0 then
game.PointsService:AwardPoints(plr.userId,1) 
end
end 
end) 
end)

Now, to show a GUI that shows the amount of playerpoints available, make a gui and put this script inside it. You can also just look in output and check the prints if you don't want to use this.

points = Game:GetService("PointsService")
while true do
	wait(1)
	script.Parent.Text = "There are currently  " ..points:GetAwardablePoints() .. " points left..."
end

Now, to get playerpoints awarded, I suggest making a gui that sells dev products or gamepasses. To create a dev product, go to Configure then click the tab Developer Products then click Create New.

Hope this helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.