You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I added a script that gives to a certain player a badge and a random tool when he get 12/12 eggs. -
What is the issue? Include screenshots / videos if possible!
When the player hit 12 eggs, they don’t receive the badge. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Yes, but I didn’t found much information.
Script when player get 12 eggs send a Remote event (Local script → Server)
if #eggsFound == #eggs then
game.ReplicatedStorage.OnAllEggsFound:FireServer()
Badge script (not a local script)
game.ReplicatedStorage.OnAllEggsFound.OnServerEvent:Connect(function(plr)
plr:WaitForChild("PlayerGui"):WaitForChild("BadgeService"):AwardBadge(plr.UserId, 3748402732808653)
local folder = game.ServerStorage.randomitem
local items = folder:GetChildren()
local randomItem = items[math.random(1, #items)]
local newItem = randomItem:Clone()
newItem.Parent = plr.Backpack
end)