In my game I wanted to have players receive items for having a badge, I took a script that did this but with game passes instead of badges and changed it up so it would work with badges, the problem is, the script does not work, after fiddling with is for a while I decided that I should come here for help with the script. Any assistance would be greatly appreciated, here is the script:
id = 12312321 --Badge id
game.Players.PlayerAdded:connect(function(plr)
repeat wait() until plr.Character
if game:GetService("BadgeService"):PlayerHasBadge(plr, id) then
local tool = game.ServerStorage["Dream Bat"]
tool:clone().Parent = plr.Backpack
tool:clone().Parent = plr.StarterGear
end
end)

3 comments
try using playerownsasset http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/PlayerOwnsAsset
^ ROBLOX announced that PlayerOwnsAsset will not work for badges anymore.
http://devforum.roblox.com/t/upcoming-changes-to-game-badges/35667