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

Making a Touch Player Points awarder?

Asked by
u_g 90
11 years ago

How would you do this?

1 answer

Log in to vote
0
Answered by
jav2612 180
11 years ago

I havn't messed with playerpoints yet, but based on the wiki I'm guessing you would do something like this:

01ps = game:GetService("PointsService")
02PART = whereeverthepartis
03 
04function Touched(p)
05    if p.Parent:FindFirstChild("Humanoid") ~= nil then
06        player = p.Parent:GetPlayerFromCharacter()
07        if ps:GetAwardablePoints() > 0 then
08            ps:AwardPoints(player.userId, 1)
09        end
10    end
11end
12 
13PART.Touched:connect(Touched)
Ad

Answer this question