-- Script to give all badges to a player on demand (e.g., when a button is clicked) local BadgeService = game:GetService("BadgeService") local badges = {} -- Function to get all badges in the game local function getAllBadges() local success, badgeInfo = pcall(function() return BadgeService:GetBadgeInfoAsync() end) if success then return badgeInfo else warn("Failed to get badge info: " .. tostring(badgeInfo)) return {} end end badges = getAllBadges() -- Example: RemoteEvent to trigger badge awarding from client local ReplicatedStorage = game:GetService("ReplicatedStorage") local awardBadgesEvent = ReplicatedStorage:FindFirstChild("AwardBadgesEvent") if not awardBadgesEvent then awardBadgesEvent = Instance.new("RemoteEvent") awardBadgesEvent.Name = "AwardBadgesEvent" awardBadgesEvent.Parent = ReplicatedStorage end -- When the event is fired by a client, award all badges to that player awardBadgesEvent.OnServerEvent:Connect(function(player) for _, badge in pairs(badges) do local badgeId = badge.Id or badge.BadgeId or badge local success, err = pcall(function() BadgeService:AwardBadge(player.UserId, badgeId) end) if not success then warn("Failed to award badge " .. badgeId .. " to " .. player.Name .. ": " .. tostring(err)) end end end)