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