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

how can i give people clothes if they are on a certain team and only when a round began?

Asked by 3 years ago

im making an scp game

2 answers

Log in to vote
1
Answered by
Cirillix 110
3 years ago

Just add that when the round starts

for i,v in pairs(game.Players:GetPlayers()) do
    if v.Team == game.Teams.Team1 then --First team
           if v.Character:FindFirstChild("Shirt") then
               v.Character:FindFirstChild("Shirt").ShirtTemplate = "" -- shirt asset id
           else
               local Shirt = Instance.new("Shirt")
               Shirt.Parent = v.Character
               Shirt.ShirtTemplate = "" -- shirt asset id
           end
      elseif v.Team == game.Teams.Team2 then --Second team
          if v.Character:FindFirstChild("Shirt") then
               v.Character:FindFirstChild("Shirt").ShirtTemplate = "" -- shirt asset id
          else
               local Shirt = Instance.new("Shirt")
               Shirt.Parent = v.Character
               Shirt.ShirtTemplate = "" -- shirt asset id
          end
      end
end
Ad
Log in to vote
0
Answered by
vra000 22
3 years ago

You could do a player added function and do an if statement to see if the player is on that team. Here's what I mean:

game.Players.PlayerAdded:Connect(function(player)
    if player.TeamColor == "" then -- In the quotes, put your team's color
        player.Character:WaitForChild("Shirt").ShirtTemplate = "rbxassetid"--Your shirt id
    end
end)
0
yeah but, the problem is i want it to be only when a round began momgggbghghghghg 50 — 3y

Answer this question