Custom Badge Notification Tutorial

NEW TUTORIAL: (NEW) Custom Badge Notification Tutorial

I don’t feel like explaining too much right now, so I’ll explain everything briefly.

I’ll probably make a much more detailed tutorial later, but let’s just get into the tutorial.

Make sure to have a badge ready and to have a Badge UI similar to this (No need to have the UICorners, Gradients, and stuff):
image

After you have the UI set up, move it into the replicated storage

Now insert a local script into StarterPlayerScripts (located in StarterPlayer):
image

Now copy and paste this code that disables the default badge notification:

game:GetService("StarterGui"):SetCore("BadgesNotificationsActive",false)

After that, insert a module script into the ServerScriptService named BadgeUI and insert this code in between the local module = {} and return module:

function module.OpenBadgeUI(UserId,BadgeId)
    local Name = game:GetService("Players"):GetNameFromUserIdAsync(UserId)
    local BadgeUI = game:GetService("ReplicatedStorage").Badge:Clone()
    local frame = BadgeUI.Frame
    local TS = game:GetService("TweenService")
 
    local tweenInfo = TweenInfo.new(
        2,
        Enum.EasingStyle.Quad,
        Enum.EasingDirection.InOut,
        0,
        false,
        0.2
    )
    
    local positionTweenOpen = TS:Create(
        frame,
        tweenInfo,
        {Position = UDim2.new(-- Your open position)}
    )
    
    local positionTweenClose = TS:Create(
        frame,
        tweenInfo,
        {Position = UDim2.new(-- Your closed position)}
    )
    
    BadgeUI.Parent = game:GetService("Players")[Name].PlayerGui
    
    frame.Title.Text = game:GetService("BadgeService"):GetBadgeInfoAsync(BadgeId).Name
    frame.Description.Text = game:GetService("BadgeService"):GetBadgeInfoAsync(BadgeId).Description
    frame.Icon.Image = "https://www.roblox.com/asset/?id="..game:GetService("BadgeService"):GetBadgeInfoAsync(BadgeId).IconImageId
    
    positionTweenOpen:Play()
    
    task.wait(8) -- You can change this to the time you want the badge to stay on the screen for (in seconds)
    
    positionTweenClose:Play()
        positionTweenClose.Completed:Connect(function()
        BadgeUI:Destroy()
    end)
end

I believe that this shouldn’t be too hard to change, so let’s use this module in this welcome badge script. Insert a server script into the ServerScriptService and name the script WelcomeBadge and insert this code:

local BadgeId = -- Your Badge ID
local BadgeUI = require(script.Parent.BadgeUI)
local BadgeService = game:GetService("BadgeService")

game:GetService("Players").PlayerAdded:Connect(function(plr)
    local userId = plr.UserId
    task.wait(2)
    
    if not BadgeService:UserHasBadgeAsync(userId,BadgeId) then
        BadgeService:AwardBadge(userId,BadgeId)
        BadgeUI.OpenBadgeUI(userId,BadgeId)
    end
end)

Video:

Yeah, that’s it. This should work. If it doesn’t, let me know. If you have any concerns, feel free to let me know. Thanks for reading.

14 Likes

I wish you could show us what the badge UI looks like

Other than that, this is awesome

1 Like

Amazing tutorial, but you can easily do this by just using Pads instead of increasing / decreasing position.

1 Like

Oh right, I forgot that. I’ll add that!

What do you mean by Pads? I have never heard of that.

I forgot the name of it. CHARACTER LIMITTTTTTTTTTTTTTTTTTT

Is it UIPadding? That’s the only thing that I can think of that has the word “pad” in it.

yeah. CHARACTER LIMMMMMMMMMMMMMMMMMMMMITE

How would I use UIPadding to move the UI?

use padding to lower the values. If there is multiple notifications and you want to lower both, Make a new frame not inside of org, then import that notification inside of the frame. its simple

1 Like

Please refrain from posting tutorials just for the hell of it. You mentioned in your post:


It doesn’t really cut it for a tutorial either. It just seems too rushed, and all you do is copy and paste code.

1 Like

Yeah, I know but I am going to make a very detailed tutorial soon and this is mainly for people who need code for a custom badge notification. What category do you suggest that I should move it to?

Here’s the new tutorial: (NEW) Custom Badge Notification Tutorial