Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

it keeps highlighting the line of the script ?

****Hi, i got a badge giver script that doesent work, i replaced the 00000 whit my own id, it just that, in the scrpit, the.. program... keeps highlighting the Id from line 8:

 (plr.UserId, **id** )

i tried to replace it whit ID or Id, but it keeps highlighting them, why?

 local badgeservice = game:GetService("BadgeService")
  local id = ("0000000") -
script.Parent.Touched:Connect(function(hit)

	if hit.Parent:FindFirstChild("Humanoid") then

	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
	badgeservice:AwardBadge(plr.UserId, id)
end
end)

2 answers

✓ Accepted answer

I decided to type It In cuz why not, also, I tried to explain It

local badgeservice = game:GetService("BadgeService") -- Badge service
local id = 000000 ---Badge ID, change It Into yours

script.Parent.Touched:Connect(function(hit) ---If someone touches the part
	local Humanoid = hit.Parent:WaitForChild("Humanoid") -- If hit.Parent has a humanoid
	if Humanoid then --If It founds a humanoid
		local Player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) ---Find If the humanoid Is a player or NPC
		if Player then --If Its a player then
			badgeservice:AwardBadge(Player.UserId, id) ---Rewards badge
		end
	end
end)

Yeah.. so, i replaced the Id in line 08 whit my id, now it works.. how simple.

This discussion is preserved as it was. New answers, comments, and votes are closed.