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

How do I give Player points to others?

Asked by 10 years ago

I made a script for my game that gives player points to others if they have 10 KOS. And does this work? -- declare service local PointsService = Game:GetService("PointsService")

-- Bind function to player added event game.Players.PlayerAdded:connect(function(player) -- Get total number of points the game has available local pointsToAward = PointsService:GetAwardablePoints() -- Get total number of points this game has already awarded to the player local universeBalance = PointsService:GetGamePointBalance(player.userId) -- 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. if ( pointsToAward > 345 and universeBalance == 5888888) then PointsService:AwardPoints(player.userId, 14643959) 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)

1
Please use the syntax highlighter. Select all of your code, and then click the small Lua symbol just above the text box. After that, make sure the code is tabbed as it would be in ROBLOX studio's script editor. adark 5487 — 10y

1 answer

Log in to vote
0
Answered by
MixCorp 70
10 years ago

I have no idea what any of this jumble is, But the Player Point methods, Events, and properties are here: http://wiki.roblox.com/index.php?title=RBX.lua.PointsService_(Object)

Ad

Answer this question