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

I need a script that enables a GUI if a person is on a certain team.?

Asked by 9 years ago

Basically, if the person's team changes to the teamcolor "Lavender" then a scoreboard GUI would be enabled, allowing them to use the scoreboard. It would have to use the changed event, but I'm not sure how exactly I'd do that. Help please?

0
Try it yourself duckyo01 120 — 9y
0
.. I have. I came here for help, because I am unsure of what to do. Ethan_Waike 156 — 9y
0
There now please upvote it and accept duckyo01 120 — 9y
0
Thanks :) Ethan_Waike 156 — 9y
0
np duckyo01 120 — 9y

1 answer

Log in to vote
2
Answered by
duckyo01 120
9 years ago

Okay follow the instructions

TeamName = "" -- Put name of the team here (caps don't matter)
-- Put this script in the Gui, and touch nothing else.
Teams = game:GetService("Teams")
Player = game.Players.LocalPlayer
Gui = nil
function TrackGui(Par,LastPar)
    if Par.ClassName=="PlayerGui" then
        Gui = LastPar
    else
        TrackGui(Par.Parent,Par)
    end
end
print("Tracking...")
TrackGui(script.Parent,nil)
print("Found the Gui! ("..Gui.Name..")")
if #Teams:GetChildren()>0 then
    for num,team in pairs(Teams:GetChildren()) do
        if string.lower(team.Name)==string.lower(TeamName) then
            if team.TeamColor~=Player.TeamColor then
                script.Parent:remove()
            end
        end
    end
end

-- duckyo01

Remember paste this into a localscript then add the script to the gui you want.

Ad

Answer this question