I’m having trouble trying to figure this out. The only thing I can find relating to this is when you reach a certain leaderstat value, it gives the badge.
I found this, it might help:
local BadgeService = game:GetService(“BadgeService”)
local Players = game:GetService(“Players”)
local badgeId = 00000000 – Change this to your badge ID
local function onPlayerAdded(player)
– Check if the player has the badge
local success, hasBadge = pcall(function()
return BadgeService:UserHasBadgeAsync(player.UserId, badgeId)
end)
– If there’s an error, issue a warning and exit the function
if not success then
warn(“Error while checking if player has badge!”)
return
end
if hasBadge then
— add a point to their leader stats here
end
end
– Connect “PlayerAdded” events to the “onPlayerAdded()” function
Players.PlayerAdded:Connect(onPlayerAdded)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.