Hi it’s been 3 hours since i have tried many things to fix this code but anything i do it doesn’t seem to be working
code:
local STag = script.Species
local NTag = script.NameRank
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local Head = char.Head
local SpeciesTag = STag:Clone()
local NameTag = NTag:Clone()
NameTag.Parent = Head
SpeciesTag.Parent = Head
SpeciesTag.TextLabel.Text = "Custom | Mortal"
NameTag.TextLabel.Text = plr.Name.." | "..plr:GetRoleInGroup(16721078)
if plr:GetRankInGroup(16721078) == 254 or plr:GetRankInGroup(16721078) == 253 then
NameTag.TextLabel.UIGradient.Enabled = true
end
end)
end)
It only works on me when i join but no one else and when i test it with 2 players in studio it works there
From the information given, it appears that the code has a problem in that it only functions for the player who controls the server on which the game is being played, but not for new participants.
This might be the result of the script only being run on the client side of the server owner and not on the client side of any new participants. You must make sure that the script is distributed to every player who joins the game in order to correct this.
To interact between the server and the clients in this manner, use a RemoteEvent or RemoteFunction. In the server script, you can build a RemoteEvent or RemoteFunction.
If no errors are being thrown in the output, it may be that you don’t provide any “else” statement after the following line:
My guess is, the script knows what to do for you, since your rank is one of the two options, but other ranks it has no indication of how to handle them.
Well I read other dev forums questions about this same problem and i found out that it should be placed inside the humanoidrootpart instead of head and i should just fix the studsoffset so yeah i did that and it worked