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

Player IsInGroup not working?

Hello, I have a DC and I'm removing and re-creating the scripts, and the team thing doesn't work. Can anyone help me? (There is more of the script and this is a snipet, I think this is what caused the problem because everything else works.)

	if game.Players.LocalPlayer:IsInGroup(1181092) then
		script.Parent.Parent.Parent.TeamService.Americans.Visible = true
	end
	if game.Player.LocalPlayer:IsInGroup(1214465) then
		script.Parent.Parent.Parent.TeamService.SS.Visible = true
	end
	if game.Players.Localplayer:IsInGroup(1214432) then
		script.Parent.Parent.Parent.TeamService.StateDept.Visible = true
	end
	if game.Players.LocalPlayer:IsInGroup(1214694) then
		script.Parent.Parent.Parent.TeamService.Congress.Visible = true
	end
	if game.Players.LocalPlayer:IsInGroup(1215144) then
		script.Parent.Parent.Parent.TeamService.DefenseDept.Visible = true
	end
	if game.Players.LocalPlayer:IsInGroup(1215148) then
		script.Parent.Parent.Parent.TeamService.SWAT.Visible = true
	end
	if game.Players.LocalPlayer:IsInGroup(1215145) then
		script.Parent.Parent.Parent.TeamService.USCP.Visible = true
	end
	if game.Players.LocalPlayer:IsInGroup(1215003) then
		script.Parent.Parent.Parent.TeamService.DOJ.Visible = true
	end
	if game.Players.LocalPlayer:IsInGroup(1218846) then
		script.Parent.Parent.Parent.TeamService.HLS.Visible = true
	end
	if game.Players.LocalPlayer:IsInGroup(1213695) then
		script.Parent.Parent.Parent.TeamService.MService.Visible = true
	end

1 answer

(SUGGESTION NOT ANSWER) I personally would not use a local script for this... I would use.........

for _, Plr in pairs(game.Players:GetPlayers()) do
if Plr:IsInGroup(1181092) then
T=Instance.new('Team',game:GetService("Teams"))
T.Name=('Americans")
T.Color=BrickColor.new('Really blue')
wait() -- data load...
game.Players[Plr.Name].TeamColor=BrickColor.new('Really blue')
end
end 

1 comment

0

There are pre-made buttons that are all invisible and have team scripts, so I wouldn't do that.

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