Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I make this script Filtering Enabled?

Asked by 3 years ago
Edited 3 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.

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)
0
I'm assuming you're cloning a BillboardGui. Use a RemoteEvent then and clone it on the server. AntiWorldliness 868 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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.

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. CptShaddow 2 — 3y
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. Warfaresh0t 414 — 3y
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. CptShaddow 2 — 3y
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. Warfaresh0t 414 — 3y
Ad

Answer this question