Why isn't this VIP Nametag script working?

Keep in mind I’m not a scripter I got this from the toolbox, I just edited the gamepass ID and RBG

local gamepassId = 13157002 – Your gamepass id
local service = game:GetService(“MarketplaceService”)

game.Players.PlayerAdded:Connect(function(player)
if (service:UserOwnsGamePassAsync(player.UserId, gamepassId)) then – check if have gamepass

    local tags = { -- table for tags
        { -- first tag
            TagText = "VIP", -- Tag text
            TagColor = Color3.fromRGB(255, 255, 0) -- TagColor 
        }
    }

    local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService) -- Get chat service

    -- Get speaker
    local speaker = nil
    while speaker == nil do
        speaker = ChatService:GetSpeaker(player.Name)
        if speaker ~= nil then break end
        wait(0.01)
    end

    speaker:SetExtraData("Tags",tags) -- Set tags
    speaker:SetExtraData("ChatColor",Color3.fromRGB(255, 255, 255)) -- Change chat color, and dont use BrickColor.new(...).Color
end

What exactly isn’t working? Is it printing any errors? You can always try print debugging to see if a function isn’t working properly as well.

Well I configured all the stuff but the Nametag UI doesn’t appear over the player. I tested it in studio and in game neither worked.

It’s not supposed to appear over the player, it’s supposed to modify chat tags.
For what you are talking about, you need a script that clones a GUI to certain players, this script doesn’t do that. The ChatService refers to in-game chat, as does GetSpeaker and all that. It’s part of the Lua Chat System.

Oh thanks, I misread the actual script. :smile:

1 Like