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

Expected <eof>, got 'end'?

Asked by 3 years ago

Help please. Writes an error Expected <eof>, got 'end' here is the script

local plr = game.Players.LocalPlayer
local vipServerOwnerId = game.ReplicatedStorage.Interactions.Server.GetVIPServerOwnerID:InvokeServer()

local specialColors = {}
specialColors["635035673"] = Color3.fromRGB(255, 221, 0) -- BlockyShadows

function givePlayerNameTag(thisPlr)

    -- Make sure player
    local chr = thisPlr.Character
    if chr ~= nil and thisPlr ~= plr then

        -- Create nametag
        local tag = script.NameTag:clone()

        -- Set information
        tag.Label.Text = thisPlr.Name
        if thisPlr.UserId == vipServerOwnerId then
            tag.Label.Text = "[SERVER OWNER] " .. thisPlr.Name
            tag.Label.TextColor3 = Color3.fromRGB(255, 0, 255)
        elseif thisPlr.UserId == "erer" then
            tag.Label.Text = "[CREATOR] " .. thisPlr.Name
            tag.Label.TextColor3 = Color3.fromRGB(255, 0, 0)
        end
        elseif thisPlr.UserId == "OsipStar4ik" then
            tag.Label.Text = "[DEVELOPER] " .. thisPlr.Name
            tag.Label.TextColor3 = Color3.fromRGB(255, 0, 0)
        end
        for id, c in pairs(specialColors) do
            if tostring(thisPlr.UserId) == id then
                tagLabel.TextColor3 = c
            end
        end

        -- Add to head
        tag.Parent = chr:WaitForChild("Head")

    end

"" 

game.Players.PlayerAdded:connect(function(thisPlr)

    -- Assign event
    thisPlr.CharacterAdded:connect(function()
        givePlayerNameTag(thisPlr)
    end)
    givePlayerNameTag(thisPlr)

end)

for _, i in pairs(game.Players:GetPlayers()) do
    i.CharacterAdded:connect(function()
        givePlayerNameTag(i)
    end)
    givePlayerNameTag(i)
end

1 answer

Log in to vote
0
Answered by 3 years ago

Seems like the only problem here was that you added a random quote string at line 40, so I simply removed that.

local plr = game.Players.LocalPlayer
local vipServerOwnerId = game.ReplicatedStorage.Interactions.Server.GetVIPServerOwnerID:InvokeServer()

local specialColors = {}
specialColors["635035673"] = Color3.fromRGB(255, 221, 0) -- BlockyShadows

function givePlayerNameTag(thisPlr)

    -- Make sure player
    local chr = thisPlr.Character
    if chr ~= nil and thisPlr ~= plr then

        -- Create nametag
        local tag = script.NameTag:clone()

        -- Set information
        tag.Label.Text = thisPlr.Name
        if thisPlr.UserId == vipServerOwnerId then
            tag.Label.Text = "[SERVER OWNER] " .. thisPlr.Name
            tag.Label.TextColor3 = Color3.fromRGB(255, 0, 255)
        elseif thisPlr.UserId == "erer" then
            tag.Label.Text = "[CREATOR] " .. thisPlr.Name
            tag.Label.TextColor3 = Color3.fromRGB(255, 0, 0)
        end
        elseif thisPlr.UserId == "OsipStar4ik" then
            tag.Label.Text = "[DEVELOPER] " .. thisPlr.Name
            tag.Label.TextColor3 = Color3.fromRGB(255, 0, 0)
        end
        for id, c in pairs(specialColors) do
            if tostring(thisPlr.UserId) == id then
                tagLabel.TextColor3 = c
            end
        end

        -- Add to head
        tag.Parent = chr:WaitForChild("Head")

    end


game.Players.PlayerAdded:connect(function(thisPlr)

    -- Assign event
    thisPlr.CharacterAdded:connect(function()
        givePlayerNameTag(thisPlr)
    end)
    givePlayerNameTag(thisPlr)

end)

for _, i in pairs(game.Players:GetPlayers()) do
    i.CharacterAdded:connect(function()
        givePlayerNameTag(i)
    end)
    givePlayerNameTag(i)
end
0
I have another problem OsipStar4ik 32 — 3y
0
Players.OsipStar4ik.PlayerScripts.NameTagGiver:36: attempt to index nil with 'Parent' OsipStar4ik 32 — 3y
0
I think you might have misused the "end" at line 24, so try removing it and adding another "end" to line 37 RedWirePlatinum 53 — 3y
0
specifically add it after the "tag.Parent = chr:WaitForChild("Head")" part RedWirePlatinum 53 — 3y
Ad

Answer this question