Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local BadgeService = game:GetService("BadgeService")
- local WELCOME_BADGE_ID = 1234567890 -- ganti dengan BadgeId kamu
- Players.PlayerAdded:Connect(function(player)
- -- coba kasih badge
- local success, result = pcall(function()
- if not BadgeService:UserHasBadgeAsync(player.UserId, WELCOME_BADGE_ID) then
- BadgeService:AwardBadge(player.UserId, WELCOME_BADGE_ID)
- print(player.Name .. " awarded Welcome Badge!")
- else
- print(player.Name .. " already has the Welcome Badge.")
- end
- end)
- if not success then
- warn("Error giving badge: " .. tostring(result))
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment