What is right what is wrong

the problem that happened to me is that I did all this code right and it didn’t work, what’s wrong here?

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

local id = 2124958957
local Creadores = {"aba1231900","SofoCrack2020","cuentaprueba123899" , "Drxgo_XD", "RexCaft_357", "DevLunzar",  "robertomonica", "itz_alejandrovip23","LONS289","prince11and2","YarelaDeveloper","JaxonRelaxinYt","ScratchyDragon","Wolves_Messi","Snacky303","SOTR654" }
Players.PlayerAdded:Connect(function (player)
	player.CharacterAdded:Connect(function(character)
		
		


		for i in pairs(Creadores) do
			if Creadores [ i] == player.Name then
				local HumanoidRootPart = character.HumanoidRootPart
				HumanoidRootPart.Touched:Connect(function(hit)
				if hit.Parent:FindFirstChild("Humanoid") then
					local PlayerGanador = Players:GetPlayerFromCharacter(hit.Parent)
						BadgeService: AwardBadge(PlayerGanador.UserId,)
						print("emblema concedido")
end`
1 Like

First, please tell us what does your script do. Secondly, please describe the problem briefly. We can’t help you without these informations.

You forgot to include a v here.

Creadores[i]

Use pcall() to prevent any stupid errors screwing up the code.

And PLEASE finish your end statements for your if statements and for loops statements.

what the script does is that when you touch some of the creators of the experience (game) it will give you a badge.

You forgot to enter the badge ID.

@Forummer
this is the id
you did not analyze the script properly

BadgeService: AwardBadge(PlayerGanador.UserId,)

You need to pass it as the second argument here.

1 Like

https://developer.roblox.com/en-us/api-reference/function/BadgeService/AwardBadge

You need two arguments, the player’s user ID of which you are awarding the badge to and the badge ID itself.

There’s no need to be rude, especially when I solved your issue.

1 Like