Advertisement
Showy19

MaxPlayers Script

Jan 12th, 2021
3,625
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. local player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
  2. local teams = game:GetService("Teams")
  3.  
  4. local blueTeam = game.Teams.Azul                       --Nombre del equipo (Cambialo al nombre de tu equipo)
  5.  
  6. local MaxPlayers = blueTeam:GetPlayers()
  7. local val = #MaxPlayers
  8.  
  9. script.Parent.MouseButton1Click:Connect(function()
  10.     if val == 2 then                                  --Si hay 2 personas en el equipo, el jugador no podra entrar (0 = nadie puede entrar)
  11.         script.Parent.Text = "Equipo Completo"        --Texto que pondra cuando el equipo este lleno
  12.         wait(1.5)                                     --Tiempo antes de que el texto cambie (en segundos)
  13.         script.Parent.Text = "Equipo Azul"
  14.     elseif val < 2 then                               --Si hay menos de 2 personas en el equipo, el jugador podra entrar (0 = nadie)
  15.         player.Team = blueTeam
  16.     end
  17. end)
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement