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

How can I make this include a tag?

Asked by 9 years ago

So I basically want it to be able to automatically add the rank and I'd manually add the groups as seen below.

http://gyazo.com/a85db0100188f020fbb0b95bd1e3e44f

If anyone could help me out with what is wrong with this, that would be very helpful! :)

if Player:IsInGroup(2535914) then
    newName.Name = "[LEGV][" .. Player:RoleInGroup(2535914) .. "] "and  .. Player.Name

1 answer

Log in to vote
1
Answered by 9 years ago
  1. You need an "end"
  2. Who is "Player"?
  3. What is "newName"?
  4. Why does it have an "and" when it there isn't even an if statement on line 2.
game.Players.PlayerAdded:connect(function(Player)
    if Player:IsInGroup(2535914) then
        newName.Name = "[LEGV][" .. Player:RoleInGroup(2535914) .. "] ".. Player.Name --What is "new name?"
    end
end)

Try this with a function:

function newName(StatName, char) --Edit this part.
    local billboard = Instance.new("BillboardGui", char)
    local name = Instance.new("TextLabel", billboard)
    name.BackgroundTransparency = 1
    billboard.Size = UDim2.new(0,1,0,1)
    name.Text = StatName
end

game.Players.PlayerAdded:connect(function(Player)
    if Player:IsInGroup(2535914) then
        Player.NameDisplayDistance = 0
        newName("[LEGV]["..Player:RoleInGroup(2535914).."]"..Player.Name, Player.Character)
    end
end)

Hope this helps. You had a lot of errors.

0
The part that says "Edit this part" you need to edit because the name will not be in the center of the player. EzraNehemiah_TF2 3552 — 9y
Ad

Answer this question