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

Am I checking for the badge correctly?

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 :/

1 comment

0

Change one of the 'pointgiver' variables.

1 answer

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

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