Overhead GUI for ranks

I was wondering if I there was and type of script that could match what I’m looking for like :

  • I’m looking for a ranktag script that you can take the rank above your head and then be able turn it off by pressing a letter.
    _

I code I just don’t know how make a code like that… Can anyone help me?

4 Likes

Does anyone know how to??

(30 Characters)

2 Likes

Use a BillboardGui, UserInputService and Player:GetRankInGroup

5 Likes

(The script mentioned has to be a LocalScript not a regular script.)
To do something like this you have to first start with the head tag using a billboard gui, Then putting it inside a script then making a GUI inside of StarterGUI and then inside the ScreenGui you create make a button and put a local script under inside the main Billboard GUI and inside the script write (The script has to be in ServerScriptService) :

local ServerScriptService = game.ServerScriptService
script.BillboardGUI.TextLabel.MouseButton1Click:Connect(function()
	ServerScriptService.ScriptsName.Disabled = true -- Change "ScriptsName" to what the script's name is.
end)
3 Likes

How would I connect that my other script like the one that get’s the rank above there head could I just put it under it right?

2 Likes

Oh, You want the head tag to be the person’s group rank?
I would need to know the group ID or Link.

2 Likes

This is the link to the group I’m trying teach people how develop but :
https://www.roblox.com/groups/3309343/The-DEVs#!/about

3 Likes

Use this function to get the role in the group

local groupId = -- your group's ID
player:GetRoleInGroup(groupId)
3 Likes

Oh also sorry I messed up the code so I fixed it, Sorry about that.

2 Likes

Yes, That should work perfectly.

1 Like

So what about the group like would I put the first like the script leads group id than add that script? Which would be the one that would disable when someone pressed D or some thing around that.

2 Likes

You can do this using UserInputService and remote events. With a local script inside StarterPlayerScripts that detects when a player presses a key on their keyboard and fires an event to the server to turn off their tag.

–Example Code for client input

local UIS = game:GetService("UserInputService")
local remoteEvent = game:GetService("ReplicatedStorage").RemoteEvent

UIS.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.A then -- Change "A" to the key you want the player to press
		remoteEvent:FireServer()
	end
end)

–Script in ServerScriptService to detect when a player wants to turn off their tag

local remoteEvent = game:GetService("ReplicatedStorage").RemoteEvent

remoteEvent.OnServerEvent:Connect(function(player)
	print(player, "sent a request to turn off their tag!")
	--Code here to change the tag goes here
end)

If you only want the tag to be turned off for the player turning it off you can skip the remote event and edit the code in the script detecting when the player presses a key.

Example:

local UIS = game:GetService("UserInputService")
local remoteEvent = game:GetService("ReplicatedStorage").RemoteEvent

UIS.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.A then -- Change "A" to the key you want the player to press
		print("Player turned off their tag locally")
		--Code to change the tag goes here
	end
end)
1 Like

@CriticCritic Would I add a part than a billboard GUI > Text Label > Transparency 0 > Move the BillBoard to ServerScriptService than add a script?

1 Like

In your group’s case it would be:

local groupId = 3309343
player:GetRoleInGroup(groupId)
2 Likes

What about the the ability to turn disable the rank tag?

1 Like

you probably want to use UserInputService

local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(InputBegan, GameProcess))
    if InputBegan.KeyCode == Enum.KeyCode.E then
        --fire a remote to disable/enable on server
    end
end)

Make a ScreenGui with a button and inside the button make a localscript then use the .Disable = true on the head tag script.

local ServerScriptService=game.ServerScriptService
script.Parent.MouseButton1Click(function()
ServerScriptService.ScriptsName.Disabled = true --Change the "ScriptsName" to the head tag's script and make sure it's in the ServerScriptService.
end)

That’s the easiest way that I use.

2 Likes

So would it some thing like---- local groupId = 3309343
player:GetRoleInGroup(groupId)

local UserInputService = game:GetService(“UserInputService”)

UserInputService.InputBegan:Connect(function(InputBegan, GameProcess))
if InputBegan.KeyCode == Enum.KeyCode.E then
–fire a remote to disable/enable on server
end
end)

2 Likes

I know how make rank tag scripts I just need this specific for a reason I just insert a script usually

2 Likes

you already created one billboard?