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

Am I checking for the badge correctly?

Asked by 10 years ago
local pointgiver = script.Parent --change part to name the name of the part
local BadgeId = 167370291

pointgiver.Touched:connect(function(pointgiver)--change part to the name of the part
local g = game.Players:GetPlayerFromCharacter(pointgiver.Parent)
        if game:GetService("BadgeService"):UserHasBadge(g.userId, BadgeId) then
        print'Has badge'
            elseif pointgiver:IsA("Part") and (g) then --Makes sure the part is a part
            pps = game:GetService("PointsService")--Declares the point service
                if pps:GetAwardablePoints() >= 50 then --change 1 to how much points you get for touching the part
                pps:AwardPoints(g.userId, 50) --doesent matter
                print'pts awarded'
                end
        end
end)

Should this be functioning correctly?

It doesn't seem to be :/

0
Change one of the 'pointgiver' variables. Shawnyg 4330 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

I don't see anything wrong I'll check on it a little more though.

Ad

Answer this question