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
if player:IsInGroup then, dont do this BUT 
if player.TeamColor == teams.Example.TeamColor then
player.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...

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.

Ad
Log in to vote
0
Answered by 7 years ago

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

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