-- ROBLOX scripter hackers, see what you can do with this:
-- game:GetService("BadgeService"):UserHasBadge(userid, badgeid)


local db = false


function OnTouch(part)
	if db then return else db = true end
	if (part.Parent:FindFirstChild("Humanoid") ~= nil) then
		local p = game.Players:GetPlayerFromCharacter(part.Parent)
		if (p ~= nil) then
			if not game:GetService("BadgeService"):UserHasBadge(p.userId, script.Parent.BadgeID.Value) then
				print("Awarding BadgeID: " ..script.Parent.BadgeID.Value .. " to UserID: " .. p.userId)
				local b = game:GetService("BadgeService")
				b:AwardBadge(p.userId, script.Parent.BadgeID.Value)
				game.PointsService:AwardPoints(p.userId,1000)
				wait(4 + math.random())
			end
		end
	end
	db = false
end

script.Parent.Touched:connect(OnTouch)
