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 4 days ago

im making an scp game

2 answers

Log in to vote
1
Answered by 4 days 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
4 days 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 — 4d

Answer this question