You can write your topic however you want, but you need to answer these questions:
What do you want to achieve?
I want to make a badge that is awarded to players the FIRST time they join!
What is the issue?
I tried coding this with a datastore to see if they joined before or if they have played the game before.
It didn’t really work out…
What solutions have you tried so far?
I found another “solution” on the dev forum, and it didnt work… And I’m too lazy to watch yt tutorials, sooo… Help?
if not badge:UserHasBadgeAsync(plr.UserId, id) then
badge:AwardBadge(plr,id)
end
instead of
if firsttime == true then
badge:AwardBadge(plr,id)
end
This is a more efficient way of awarding a new player the welcome badge since the script could try to award the player the badge again if their data gets reset, which can result in an error.
If this still doesn’t work then make a new script with another .PlayerAdded event with the sole purpose of giving the player the welcome badge if they’re new like this:
local badge = game:GetService("BadgeService")
local id = 123456789 --badge id here
game.Players.PlayerAdded:Connect(function(plr)
if not badge:UserHasBadgeAsync(plr.UserId, id) then
badge:AwardBadge(plr.UserId,id)
end
end)