So I have a script that is placed in a gear inside ReplicatedStorage, when the player has it in their inventory, they should receive a badge, however, it does not work. Help please.
if (script.Parent.Parent.Parent:FindFirstChild("Humanoid")) then print "lol" p = script.Parent.Parent.Parent if (p ~= nil) 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) end end
Thanks.
local marketplaceService = game:GetService("MarketplaceService") local badgeService = game:GetService("BadgeService") --code that gives tool here if not marketplaceService:PlayerOwnsAsset(plr, script.Parent.BadgeID.Value) then badgeService:AwardBadge(plr.UserId, script.Parent.BadgeID.Value) end