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

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

Asked by 7 years ago
1if player:IsInGroup then, dont do this BUT
2if player.TeamColor == teams.Example.TeamColor then
3player.WalkSpeed = 100 or whatever

2 answers

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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

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

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.

Ad
Log in to vote
0
Answered by 7 years ago

Not really. So I have this code here.

01game.Players.PlayerAdded:connect(function(player)
02    player.CharacterAdded:connect(function(character)
03        local teams = game:GetService("Teams")
04        local tools = player.BackPack:GetChildren(character)
05        if player.TeamColor == teams.Example.TeamColor then
06            for i = 1,#tools do
07                tools[i]:Remove()
08            end
09        end
10    end)
11end)

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

0
if not (team and group) or team then NexanianStudios 91 — 7y
0
pretty much what ^ said you just do if player.TeamColor == teams.Example.TeamColor and not player:IsInGroup(235151) Ultimate_Piccolo 201 — 7y
0
I edited my answer above Ultimate_Piccolo 201 — 7y

Answer this question