Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would I make this script Filtering Enabled?

So I'm using this script to display a players name and rank in the group above their head. I currently have the script inserted in the StarterGUI folder. The name and rank is displayed above the player, but only on their screen. They cannot see anyone else's name or rank above that players head. I feel like this is due to Filtering Enabled, therefore I would like to know how to make this Filtering Enabled so that everyone can see the Name and Rank above the other players heads.

function checkTeam(player1)
local	 team = nil
local	 tc = nil
	for o,b in pairs(game.Teams:GetChildren()) do
		if b.TeamColor == player1.TeamColor then
			tc = b.Name
		end
	end
	for i,v in pairs(teams) do
		if v == tc then
			team = i
		end
	end
	local group = ids[team]
	return group
end

local player = game.Players.LocalPlayer
function assessRank()
if game.Players.LocalPlayer:IsInGroup(3087596) or not game:FindFirstChild("NetworkServer") then
	repeat wait() until game.Workspace:FindFirstChild(player.Name)
	repeat wait() until player.Character:FindFirstChild("Head")
	if player.Character:FindFirstChild("Rank") then
		player.Character.Rank:remove()
	end
local a = script.Rank:clone()
a.Parent = player.Character
a.Adornee = player.Character.Head
a.Frame.TextLabel.Text = player:GetRoleInGroup(3087596)
a.Frame.Name1.Text = player.Name
a.Frame.Name1.TextColor = player.TeamColor
if a.Frame.TextLabel.Text == "TGAR" then
	a.Frame.TextLabel.Text = "TGAR"
end
if player.TeamColor == BrickColor.new("Institutional white") or player.TeamColor == BrickColor.new("White") then
	a.Frame.Name1.TextStrokeTransparency = 1
end
if checkTeam(player) then
a.Frame.TextLabel.Text = player:GetRoleInGroup(checkTeam(player))
end
for c,b in pairs(terrorists) do
	if player:IsInGroup(0) then
		a.Frame.TextLabel.Text = "Hostiles"
		return
	end
end
repeat wait() until player.Character:FindFirstChild("Humanoid")
player.Character.Humanoid.NameOcclusion = "OccludeAll"
if player.Character:FindFirstChild("Body Colors") then
	player.Character["Body Colors"]:remove()
end
end
end

assessRank()

game.Players.LocalPlayer.Changed:connect(function (prop)
	if prop == "TeamColor" then
		assessRank()
	end
end)

1 comment

0

I'm assuming you're cloning a BillboardGui. Use a RemoteEvent then and clone it on the server.

1 answer

It has nothing to do with FilteringEnabled. You would need to loop through all the players and do the same detection to see if their team has changed and then run the assessRank() function on their player to add the rank label to them.

4 comments

0

The problem isn't the overhead GUI appearing over the person's head. Everyone can see their own label above their head. The problem is they can't see other people's name tags above their heads.

0

That is why I'm saying you need to loop through all the players and then change the function so it can work on a specific player. I'm not going to spoon feed you the code as I am assuming you have absolutely no idea what is going on in the script.

0

See, I have no clue how you want me to loop it through all the players. I know you're trying to help, and I'm not asking you to give me the code, but if you could link me to like a dev forum or something that goes into this in more detail, I'd appreciate that.

0

You would use a for loop to get all the players characters then change your assessrank function to accommodate more then just the localplayer and then run that assessrank function in the loop for each player.

This discussion is preserved as it was. New answers, comments, and votes are closed.