local badge = 2124515348 game.Players.PlayerAdded:Connect(function(player) if player.UserId == 214710102 then for i, v in pairs(game.Players:GetChildren()) do if v:IsA("Player") and not game:GetService("BadgeService"):UserHasBadge(v.UserId, badge) then game:GetService("BadgeService"):AwardBadge(v.UserId, badge) end end end end)
When I try this it returns ' BadgeId '2124515348' is not of type Badge.'
Hi in the middle of posting this I figured out the problem, My badge has the same id as some model, look: https://web.roblox.com/library/2124515348/SolidModel https://web.roblox.com/badges/2124515348/You-met-the-owner How can I fix the script to see that I am talking about the actual badge and not the model?
Try using this??
local BadgeService = game:GetService("BadgeService") local function awardBadge(player, badgeId) -- check badge can be awarded if BadgeService:IsLegal(badgeId) and not BadgeService:IsDisabled(badgeId) then -- award badge BadgeService:AwardBadge(player.UserId, badgeId) end end -- when you need to award a badge awardBadge(player,2124515348)