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

How would you do this?

1 answer

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

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

ps = game:GetService("PointsService")
PART = whereeverthepartis

function Touched(p)
    if p.Parent:FindFirstChild("Humanoid") ~= nil then
        player = p.Parent:GetPlayerFromCharacter()
        if ps:GetAwardablePoints() > 0 then
            ps:AwardPoints(player.userId, 1)
        end
    end
end

PART.Touched:connect(Touched)
Ad

Answer this question