To start off, i have everything loaded, (BadgeID value, and the id in it, and clickdetector.)
This script was suggested by mohammed1336, i recently posted a question on discord but he gave me a script for this and it's not working so I've decided to ask it here.
script.Parent.ClickDetector.MouseClick:Connect(function(part)
if part.Parent:FindFirstChildOfClass("Humanoid") then
local p = game.Players:GetPlayerFromCharacter(part.Parent)
if (p ~= nil) then
print("Awarding BadgeID: " ..script.Parent.BadgeID.Value .. " to UserID: " .. p.UserId)
local b = game:GetService("BadgeService")
b:AwardBadge(p.UserId, script.Parent.BadgeID.Value)
end
end
end)
So someone basically clicks the egg (its for the badge) and they get awarded a badge.

3 comments
use if game.Players:FindFirstChild(Player.Name) then
Actually this is stupid. Why are you indexing the Player from the Players service like this.
Works well.