Hello! I’m very new to scripting and I’m having some difficulties with my nametag (i know it’s silly). I’m trying to turn this old script from a gamepass requirement to a group rank requirement. I’ve tried different variations of the script but honestly just can’t figure it out. What I’m trying to make it to do is when somebody has a specific rank in the group, it gives them text over their head saying “HR”.
function passcheck(plr, what)
if checkPass(plr, 0) then
if what.Text == "" then
what.Text = "" --The text that will appear over their head
else
what.Text = what.text..""
end
end
@jacobthedragon4ever what information is send to the function ?
And you can use this for gamepass
For ReExecute the code when player spawn / respawn you ca use
in the PlayerAdded
local id = 103728213 -- The GamePass ID Here
game.Players.PlayerAdded:Connect(function(player) -- On Player Join the game
if game:GetService("GamePassService"):PlayerHasPass(player, id) then -- VErify if the player have gamepass
print(player.Name .. " has the game pass!") -- Send Message if player has
else
print(player.Name .. " doesn't have the game pass...") --Send Message if player don't have
end
end)
What she wants is to to turn that old script from a gamepass requirement to a group rank requirement.
In conclusion, you have to use Player:GetRankInGroup() function to get the rank of the player and then check if it is on the rank that is needed.
then, use billboardgui to make an overhead gui
Sorry if I didnt really explain it properly. I already have the gamepass nametag completed. I’m trying to convert this script into a script where if somebody has the required rank on the group, the nametag text will appear.
Just remember that IsInGroup > GetRankInGroup > GetRoleInGroup is cached on the server.
You can use GroupService to avoid this type of behavior.
From what I’m seeing, there shouldn’t be anything wrong with your script, and there isn’t much to see either, & I’m pretty sure you don’t need to check what the text is currently to change it.
Just remember that 255 is the highest rank possible in the group, so there wouldn’t be anything above it. You can just do == if you want the group owner to have the HR text.