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

What would I use to have the script say if Player:IsInGroup then, Dont run this part of the code?

if player:IsInGroup then, dont do this BUT 
if player.TeamColor == teams.Example.TeamColor then
player.WalkSpeed = 100 or whatever

2 answers

You can do this by using if statements kind of the way you did...

if player.TeamColor == teams.Example.TeamColor and not player:IsInGroup(120342324) then
	print('Neat!')
end

This will make it so if the player is in the group or on the wrong team then the code will not run, but if the player isn't in the group and the player is on the team, then it will run.

Not really. So I have this code here.

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		local teams = game:GetService("Teams")
		local tools = player.BackPack:GetChildren(character)
		if player.TeamColor == teams.Example.TeamColor then
			for i = 1,#tools do 
				tools[i]:Remove()
			end
		end
	end)
end)

At line 5 I want it to be If a player is on example team, BUT IF The player is ALSO in group 1234 then DO NOT DO THIS CODE

3 comments

0

if not (team and group) or team then

0

pretty much what ^ said you just do if player.TeamColor == teams.Example.TeamColor and not player:IsInGroup(235151)

0

I edited my answer above

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