Ok so in a game I’m working on we have custom tags to replace the default Roblox name and to show group roles but it won’t add them, no errors just simply won’t add them. It does work for me and only me so I’m really confused.
NEW INFO: The developer tag is the only one that works
Here’s the script:
game.Players.PlayerAdded:Connect(function(plr)
print("Adding tag to: "..plr.Name)
local customNameClone = game.ServerStorage.Labels.CustomNameGUI:Clone()
customNameClone.TextLabel.Text = plr.DisplayName
plr.CharacterAdded:Connect(function()
customNameClone.Parent = plr.Character.Head
if plr:GetRoleInGroup(12434147) == "⭐UGC Creator" then
local displayClone = game.ServerStorage.Labels.UGC_Creator_Label:Clone()
displayClone.Parent = plr.Character.Head
end
if plr:GetRoleInGroup(12434147) == "🛠 Developer" then
local displayClone = game.ServerStorage.Labels.Dev_Label:Clone()
displayClone.Parent = plr.Character.Head
end
if plr:GetRankInGroup(12434147) == 255 or plr.UserId == 1421900113 then
local displayClone = game.ServerStorage.Labels.Founder_Label:Clone()
displayClone.Parent = plr.Character.Head
end
if plr:GetRoleInGroup(12434147) == "👥 Admin" then
local displayClone = game.ServerStorage.Labels.Admin_Label:Clone()
displayClone.Parent = plr.Character.Head
end
if plr:GetRoleInGroup(12434147) == "🌊Respected" then
local displayClone = game.ServerStorage.Labels.Respected_Label:Clone()
displayClone.Parent = plr.Character.Head
end
print("Added Successfully to: "..plr.Name)
end)
end)
A few tips because there isn’t enough information.
use a :WaitForChild("")
_ because the player needs to load everything. You might just have a really fast pc.
_ so you see, you used plr.Character, but the CharacterAddedEvent gives a character parameter, code:
<
game.Players.PlayerAdded:Connect(function(plr)
print("Adding tag to: "..plr.Name)
local customNameClone = game.ServerStorage.Labels.CustomNameGUI:Clone()
customNameClone.TextLabel.Text = plr.DisplayName
plr.CharacterAdded:Connect(function(Character)
customNameClone.Parent = Character.Head
if plr:GetRoleInGroup(12434147) == "⭐UGC Creator" then
local displayClone = game.ServerStorage.Labels.UGC_Creator_Label:Clone()
displayClone.Parent = Character.Head
end
if plr:GetRoleInGroup(12434147) == "🛠 Developer" then
local displayClone = game.ServerStorage.Labels.Dev_Label:Clone()
displayClone.Parent = Character.Head
end
if plr:GetRankInGroup(12434147) == 255 or plr.UserId == 1421900113 then
local displayClone = game.ServerStorage.Labels.Founder_Label:Clone()
displayClone.Parent = Character.Head
end
if plr:GetRoleInGroup(12434147) == "👥 Admin" then
local displayClone = game.ServerStorage.Labels.Admin_Label:Clone()
displayClone.Parent = Character.Head
end
if plr:GetRoleInGroup(12434147) == "🌊Respected" then
local displayClone = game.ServerStorage.Labels.Respected_Label:Clone()
displayClone.Parent = Character.Head
end
print("Added Successfully to: "..plr.Name)
end)
end)
\___/
oops i need to go illl give more info later, bye, hpoe this helps
I have returned, ya missed me?.. no sign*
anyways,
is it somethign to do with the group ranks? they might not be in the group.
also \it might be because of the emojis. is you say print(string.len("😀text"))
it would print not 5 but more than that.if you say orint(uft8.len("😀text"))
it would print5, i don’t know. but it is most likley the cause
mistake in the message from eariler
hm, maybe try to removing the emojis or you know what i said earlier. print(tostring("😀"))
well do that, then take the output text then replce the emoji with it, try not to remove any spaces or add any, example: "😀text" = "1a2b3ctext" not "1a2b3c text"
hope that helps
its probably something to do with emojis but im unable to find a solution to fix it, sorry
maybe you got your spaces in the name wrong?
I’m going to test the waitforchild, I can’t believe I didn’t think of that.
Also, I replaced the emojis with get rank in group now cause that way it cant ever mess up. Thanks for helping!
local players = game:GetService("Players")
local server = game:GetService("ServerStorage")
local labels = server.Labels
players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local head = character:WaitForChild("Head")
local customNameClone = labels.CustomNameGUI:Clone()
customNameClone.TextLabel.Text = player.DisplayName
customNameClone.Parent = head
if player:GetRankInGroup(12434147) == 255 or player.UserId == 1421900113 then
local displayClone = labels.Founder_Label:Clone()
displayClone.Parent = head
elseif player:GetRoleInGroup(12434147):match("Developer$") then
local displayClone = labels.Dev_Label:Clone()
displayClone.Parent = head
elseif player:GetRoleInGroup(12434147):match("UGC Creator$") then
local displayClone = labels.UGC_Creator_Label:Clone()
displayClone.Parent = head
elseif player:GetRoleInGroup(12434147):match("Admin$") then
local displayClone = labels.Admin_Label:Clone()
displayClone.Parent = head
elseif player:GetRoleInGroup(12434147):match("Respected$") then
local displayClone = labels.Respected_Label:Clone()
displayClone.Parent = head
end
end)
end)
local players = game:GetService("Players")
local server = game:GetService("ServerStorage")
local labels = server.Labels
players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character)
local head = character:WaitForChild("Head")
local customNameClone = labels.CustomNameGUI:Clone()
customNameClone.TextLabel.Text = player.DisplayName
customNameClone.Parent = head
customNameClone.Adornee = head
local displayClone
if player:GetRankInGroup(12434147) == 255 or player.UserId == 1421900113 then
displayClone = labels.Founder_Label:Clone()
elseif player:GetRoleInGroup(12434147):find("Developer") then
displayClone = labels.Dev_Label:Clone()
elseif player:GetRoleInGroup(12434147):find("UGC Creator") then
displayClone = labels.UGC_Creator_Label:Clone()
elseif player:GetRoleInGroup(12434147):find("Admin") then
displayClone = labels.Admin_Label:Clone()
elseif player:GetRoleInGroup(12434147):find("Respected") then
displayClone = labels.Respected_Label:Clone()
end
if displayClone then
displayClone.Parent = head
displayClone.Adornee = head
end
end)
end)
Well I’m not sure what you’re doing wrong but here’s the model file I was working with. It doesn’t have any of the group tags but it has the main one (which I tested with).