Player can't get a badge when they touch a part no matter what I do

Sorry for saying this again… but maybe you should also print the players UserId. If it prints correctly, then you must have the badge already, or badge service just randomly broke.

Script 1 has a typo on line 9, you misspelled BadgeService:AwardBadge(). Fix:

local BadgeService = game:GetService("BadgeService")
local id = 2140926703
local badgegive = script.Parent

badgegive.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		if not BadgeService:UserHasBadgeAsync(plr.UserId, id) then
			BadgeService:AwardBadge(plr.UserId, id)
		end
	end
end)

Wouldnt that not matter? They tried multiple scripts, right?

Like this?

print(plr.UserId)

I am testing script 3 right now.

local __BADGESERVICE = game:GetService("BadgeService")
local __PLAYERS = game:GetService("Players")
local __ID = 4574163471527 -- !! REPLACE

script.Parent.Touched:Connect(function(__PART)
	local __PLAYER = __PLAYERS:GetPlayerFromCharacter(__PART.Parent)
	if __PLAYER ~= nil then
		print("Here is your badge")
		__BADGESERVICE:AwardBadge(__PLAYER.UserId, __ID)
	end
end)
3 Likes

Yes… that should work, but you should also try weakroblox35’s script that just posted.

1 Like

Testing it right now so hopefully it works.

It still does not give me the badge. It prints “Here is your badge” but it won’t give me the badge.

You should restart studio… I looked at the badgeservice website… you did everything correct. (userId, then the badge id.) there should be no reason why this isnt working. You should restart studio, or your computer / laptop. If that still doesnt work… then you might need to uninstall studio and install it again… still doesnt work? I dont know what to tell you… it might be a pretty serious glitch.

Also here is proof that I own the badge:


There is no checkmark.

WAIT, is your badge even available for the public to be awarded?? (Enabled)

local __BADGESERVICE = game:GetService("BadgeService")
local __ID = 2457454485 -- !! REPLACE

local success, fail = pcall(function()
	return __BADGESERVICE:GetBadgeInfoAsync(__ID)
end)
if success then
	print(fail.IsEnabled)
end

You MUST also own the BADGE:

  • The player must be presently connected to the game.

  • The player must not already have the badge (note that a player may delete an awarded badge from their profile and be awarded the badge again).

  • The badge must be awarded from a server-side Script or a ModuleScript eventually required by a Script, not from a LocalScript.

  • The badge must be awarded in a place that is part of the game associated with the badge.

  • The owner of the place must also own the badge (for example, the owner must not have deleted the badge).

  • The badge must be enabled; check this using the IsEnabled property of the badge fetched through BadgeService:GetBadgeInfoAsync().
    from the docs.

Can you double check by clicking the three dots and see if theres the option to remove from inventory?


Also it says the badge is active where there is the slider to change it from active to inactive or inactive to active.

Ok… you should try weakroblox35’s script then to see if its not enabled

I’m not sure what to put it under. I have not restarted studio yet by the way.

Shouldnt you just put it in the badge script?

It’s just a normal server-script it can be put anywhere it can run. Just play the game and show output for any true/falses. Don’t put it in the .Touched (Award Badge one) script.

It printed “true”. Does that mean it’s active? I put it in a new script under ServerScriptService.

Yes of course, then the last issue is you don’t own the badge, you need to own it.