Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Add welcome badge
Browse files Browse the repository at this point in the history
  • Loading branch information
Pluviolithic committed Dec 16, 2023
1 parent a7e9974 commit bcd3047
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/server/PlayerManager/Badges.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
local Players = game:GetService "Players"
local BadgeService = game:GetService "BadgeService"
local ReplicatedStorage = game:GetService "ReplicatedStorage"

local badgeIDs = ReplicatedStorage.Config.Badges

local function awardJoinBadge(player)
if not BadgeService:UserHasBadgeAsync(player.UserId, badgeIDs.Welcome.Value) then
BadgeService:AwardBadge(player.UserId, badgeIDs.Welcome.Value)
end
end

Players.PlayerAdded:Connect(awardJoinBadge)
for _, player in Players:GetPlayers() do
task.spawn(awardJoinBadge, player)
end

return 0
1 change: 1 addition & 0 deletions src/server/PlayerManager/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ require(script.GlobalLeaderboards)
require(script.SoftShutdown)
require(script.Settings)
require(script.Tutorial)
require(script.Badges)
--require(script.NoobSpawnFix)

return 0

0 comments on commit bcd3047

Please sign in to comment.