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

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

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?

5 comments

0

Try it yourself

0

.. I have. I came here for help, because I am unsure of what to do.

0

There now please upvote it and accept

0

Thanks :)

0

np

1 answer

✓ Accepted answer

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.

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