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

How would you make a BillboardGui visible to team only? I cannot figure it out.

Asked by 5 years ago
Edited by User#24403 5 years ago
game.Players.PlayerAdded:Connect(function(Plr)
    Plr.CharacterAdded:Connect(function(chr)
        local tp = game.Teams["Test Team"]:GetChildren()
        local tp2 = game.Teams["Test Team 2"]:GetChildren() 
        if Plr.TeamColor == BrickColor.new("Black") then
            local BBG = script.Black:Clone()

            BBG.Parent = chr.Head
            for i = 1, #tp2 do
                while true do
                    wait()      
                    BBG.PlayerToHideNameFrom = tp[i]
                end
            end
        end
        if Plr.TeamColor == BrickColor.new("White") then
            local WBG = script.White:Clone()
            WBG.Parent = chr.Head

            for i = 1, #tp do   
                while true do
                    wait()  
                    WBG.PlayerToHideNameFrom = tp[i]
                end 
            end
        end
    end)    
end)

This for some reason will not work and will show both guis.


Edit: Tab your code correctly!!!!!
0
Hide the GUI individually on each client rather than the server. EpicMetatableMoment 1444 — 5y
0
Why do you have a while true loop after cloning each the GUI? Rheines 661 — 5y

Answer this question