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

Naming System Help?!

Asked by 9 years ago

So Im trying to set up a naming system but I want the people with the Gamepass to have a VIP Above their name! Please help

local passId = 180687284 -- change this to your game pass ID.
function isAuthenticated(player) -- checks to see if the player owns your pass
    return game:GetService("GamePassService"):PlayerHasPass(player, passId)
end


 -- game pass
local groupID = 1178831;
local before_name = false;
local ts = tostring
game.Players.PlayerAdded:connect(function(player)
repeat wait() until player.Character
    local char = player.Character
    getRole(player)
    player.Changed:connect(function()
        repeat wait() until player.Character
            wait()
            getRole(player)
    end)
end)
--VIP
--VIP
--VIP
game.Players.PlayerAdded:connect(function(plr, s)
    local gui = script.Title
    local clone = gui:Clone()
    clone.Parent = p.Character.Head


if isAuthenticated(plr) then
        print(plr.Name .. " has bought the game pass with id " .. passId)
        clone.F.T.Text = plr.Name..", VIP "..s 

    end
end)
--VIP
--VIP
--VIP
function createTitle(p, s)
    local gui = script.Title
    local clone = gui:Clone()
    clone.Parent = p.Character.Head
    if before_name then
        clone.F.T.Text = s.." "..p.Name
    else
        clone.F.T.Text = p.Name..", "..s
    end
end

function getRole(player)
    player.Character.Humanoid.NameOcclusion = "OccludeAll"
    if player.Character.Head:findFirstChild("Title") then
        return false
    elseif not player.Character.Head:findFirstChild("Title") and player:IsInGroup(groupID) then
        local rankString = player:GetRoleInGroup(groupID)
        createTitle(player, rankString)
    elseif not player:IsInGroup(groupID) then
        createTitle(player, "Guest")
    end
end

1 answer

Log in to vote
0
Answered by 9 years ago

Im pretty sure you can't change the players name. You will have to add a billboard gui, add a text label and change the text to the players name + whatever name you want to add.

Ad

Answer this question