Cronaldo_960

Roblox studio Script Welcome badge

Sep 13th, 2025
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | Source Code | 0 0
  1. local Players = game:GetService("Players")
  2. local BadgeService = game:GetService("BadgeService")
  3.  
  4. local WELCOME_BADGE_ID = 1234567890 -- ganti dengan BadgeId kamu
  5.  
  6. Players.PlayerAdded:Connect(function(player)
  7.     -- coba kasih badge
  8.     local success, result = pcall(function()
  9.         if not BadgeService:UserHasBadgeAsync(player.UserId, WELCOME_BADGE_ID) then
  10.             BadgeService:AwardBadge(player.UserId, WELCOME_BADGE_ID)
  11.             print(player.Name .. " awarded Welcome Badge!")
  12.         else
  13.             print(player.Name .. " already has the Welcome Badge.")
  14.         end
  15.     end)
  16.  
  17.     if not success then
  18.         warn("Error giving badge: " .. tostring(result))
  19.     end
  20. end)
Advertisement
Add Comment
Please, Sign In to add comment