How can I award a player something after they get a badge?

Alright, I work on a game called Gabriel’s Pizza World (FNAF Fangame) and I want to make an “Events” page.
That is already sorted out, in which every event contains a badge that the player can be awarded for.
Now the problem is, I want to award the player, maybe a gear or make a part transparent and CanCollide = false, but the actual problem is that I don’t know how to make such a feature.

Here’s my code, and then I want to add some other lines to check if the player has the badge, then give the player something else as well:

local ClickerDetector = script.Parent.ClickDetector
local badgeservice = game:GetService("BadgeService") --gets badgeservice
local id = 2128186652 --i guess badgeid here

	if plr then
		badgeservice:AwardBadge(plr.UserId,id) -- awards player with the service the badge by it's ID
		print("Badge successfully awarded to player.")

If you need more detail on what I need, please let me know so that I can give you the exact information you need to solve this problem.

TL:DR = I want to give the player something after they get a badge, I just don’t know how, what function it might need or simply: Don’t know what the general script is.

Use a Remote / BindableEvent depending on what you need to do, and fire the event after the player gets awarded the badge.

That’s a good idea, but how can I do it in a script? And could you show me an example of the part of the awarder? Thanks!!

I’m sorry, it’s really late for me. Can I repy to you tomorrow (with the script)?

You fire BindableEvents by doing (event instance):Fire()

If you want to fire a ReplicatedEvent from the server to the client, you use either :FireClient() or :FireAllClients()

If you want to fire an event from the client to the server you use :FireServer()

If you want to give them a gear/tool just clone the gear from serverstorage then set that clones parent to plr.StarterGear. Create a second clone and call humanoid:DequipTools() then set that parent to plr.Character

Sure! I’ll remind you. Sleep well!

Because I’m back, tell me what you want to do when the player gets the badge. Do they get awarded a gear?

local playerUserId = 0 -- your user id here or smth idk just get a user id
local badgeId -- your badge id

if game:GetService("BadgeService"):UserHasBadgeAsync(playerUserId, badgeId) then -- checking if they have the badge or not
-- add the code you want to execute if the player has a specific badge here
-- add the code you want to execute if the player does not have a specific badge here

Don’t just come straight to the Developer Forums, you can look on the Unofficial Roblox Wiki or the Developer Hub.