I have a part that makes it so you should receive a badge when you touch it, however it does not appear to be working. I have tested it multiple times to no success. It is listed below, as well as the badge.
local badgeservice = game:GetService("BadgeService")
local id = (2127621157) --put badge id here
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
badgeservice:AwardBadge(plr.UserId,id)
end
end)
local Players = game:GetService("Players") -- gets player service
local badgeservice = game:GetService("BadgeService")
local id = 2127621157 --put badge id here
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = Players:GetPlayerFromCharacter(hit.Parent)
if not badgeservice:UserHasBadgeAsync(plr.UserId, id) then -- only award the badge if the player does not own it
badgeservice:AwardBadge(plr.UserId, id)
end
end
end)