How to make a badge which gives in another game?

Hello sorry that im asking for a script but i tried to find how to make badge which you get if you touch a part but the badge gives in another game and i didn’t find it. Would be really nice if somebody could help me.

3 Likes

I don’t think you should be asking for scripts here. But here is a example of using the badge service.

local BadgeService = game:GetService("BadgeService")
local Players = game:GetService("Players")

local BADGE_ID = 0

local function awardBadge(player, badgeId)
	-- Fetch badge information
	local success, badgeInfo = pcall(function()
		return BadgeService:GetBadgeInfoAsync(badgeId)
	end)

	if success then
		-- Confirm that badge can be awarded
		if badgeInfo.IsEnabled then
			-- Award badge
			local awardSuccess, result = pcall(function()
				return BadgeService:AwardBadge(player.UserId, badgeId)
			end)

			if not awardSuccess then
				-- the AwardBadge function threw an error
				warn("Error while awarding badge:", result)
			elseif not result then
				-- the AwardBadge function did not award a badge
				warn("Failed to award badge.")
			end
		end
	else
		warn("Error while fetching badge info: " .. badgeInfo)
	end
end

local function onPlayerAdded(player)
	awardBadge(player, BADGE_ID)
end

Players.PlayerAdded:Connect(onPlayerAdded)

You can just change portions of the code so it gives the badge upon touching a part.

2 Likes

Doesn’t it need another game id?

2 Likes

No, it does not need a game ID. I believe that the badge you award must belong to a game that is yours, though.

2 Likes

I mean that the badge awards in game i want to.

2 Likes

Oh, well you can use Angermode’s example

2 Likes

What is that? I did not hear about it sorry.

2 Likes

You can only give a badge in it’s associated game.

2 Likes

I dont think so, take an example of the mimic you teleport to another game but when you teleport back you get an badge.

2 Likes

You are being teleported into a place, not a game.
image

3 Likes

Okay thanks. I already build a map in another game and i was sure you can get badge in another game.

2 Likes