So the script was suppose to make a Nametag Visible and it doesn’t work…
[Note: The full script is huge and I just added another section to the nametag script]
if Player:GetRankInGroup(BETAtestersGroup) == 255 then
game.Workspace.Nametag.Rank.BETAtesters.Visible = true
end
Are you doing this in a local script or server script? I don’t think it matters anyways, both local and server can call the function. Have you tried debugging your code, e.g adding in prints? Where is the name tag located?
This is not necessarily needed as it’s a server script already.
Since we are dealing with nametags that everyone can see, it can be controlled perfectly fine from the server.
Well, the only reason I can think of is that the function isn’t accurate on the server, as stated in the API reference.
Using this in a Script , as opposed to a LocalScript , will not get you the most up-to-date information. If a player leaves a group while they are in the game, GetRankInGroup will still think they’re in that group until they leave. However, this does not happen when used with a LocalScript.
Can you try adding a print after the conditional check? and see if it prints?
To be honest the error might be here. Reason being is you are just making the nametag in workspace visible
You really should be cloning the nametag to the player if they are in the group, then making that nametag visible
player.CharacterAdded:Connect(function(character)
if player:GetRankInGroup(groupId) == 255 then
local head = character:WaitForChild("Head")
local tag = game.Workspace.Nametag:Clone()
tag.Parent = head
tag.Visible = true
end
end)