Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

it keeps highlighting the line of the script ?

Asked by
Gigaset39 111
1 year ago

****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

Log in to vote
1
Answered by 1 year ago

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)
Ad
Log in to vote
0
Answered by
Gigaset39 111
1 year ago

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

Answer this question