How would i give a user a badge if they have a certain score in the leaderboard?

No it does not need to be a pcall to work, that is used for error handling.

No, but it is useful because if the badge request fails it will throw an error. pcalls catch errors and with xpcall you can easily log it to the console.

okay then, i won’t mark a solution since im not on studio rn but ill try this later night to see if it works, then ill give an update if it did

1 Like

Where would I locate this script? StarterPlayerScripts I Assume?

ServerScriptService; This is something that the server should be in charge of doing and not the client.

1 Like
local score,wantedscore = 0,5000

if score >= wantedscore then
	game:GetService("BadgeService"):AwardBadge(plr.UserId,BadgeId)
end
1 Like