Guest User

Untitled

a guest
Jan 23rd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. print("TeamSetting Enabled I love you iRykorz")
  2. s1 = false
  3. s2 = false
  4. s3 = false
  5. s4 = false
  6.  
  7. sd = false
  8. function onChat(text,recep)
  9. finaltext=string.lower(text)
  10. s1 = false
  11. s2 = false
  12. s3 = false
  13. s4 = false
  14. sX = false
  15.  
  16.  
  17.  
  18. if string.find(finaltext, "computer")~= nil then
  19. s1 = true
  20. if string.find(finaltext, "randomise")~= nil then
  21. s2 = true
  22. end
  23. if string.find(finaltext, "teams")~= nil then
  24. s3 = true
  25. end
  26. if string.find(finaltext, "reset")~= nil then
  27. s4 = true
  28. end
  29. end
  30.  
  31.  
  32. if s4 == true then
  33. sX = true
  34. end
  35.  
  36. if s1 == true and s2 == true and s3 == true and sX == false then
  37. Randomise()
  38. elseif s1 == true and s3 == true and sX == true then
  39. ResetTeams()
  40. end
  41.  
  42.  
  43. end
  44.  
  45.  
  46. function Randomise()
  47. local colors = {"Bright red","Bright blue"}
  48. nump = {
  49. ["Bright red"] = 0;
  50. ["Bright blue"] = 0;
  51. }
  52. for _,v in pairs(game.Players:GetPlayers()) do
  53. if v.TeamColor ~= BrickColor.new("Bright violet") or v.TeamColor ~= BrickColor.new("Dark stone grey") then
  54. r = math.random(1,2)
  55. v.TeamColor = BrickColor.new(colors[r])
  56. nump[colors[r]] = nump[colors[r]] + 1
  57. end
  58. end
  59. repeat
  60. wait()
  61. if nump["Bright red"] > nump["Bright blue"] then
  62. p = game.Players:GetPlayers()
  63. for i = 1,#p do
  64. if p[i].TeamColor == BrickColor.new("Bright red") then
  65. p[i].TeamColor = BrickColor.new("Bright blue")
  66. nump["Bright red"] = nump["Bright red"] - 1
  67. nump["Bright blue"] = nump["Bright blue"] + 1
  68. break
  69. end
  70. end
  71. elseif nump["Bright red"] < nump ["Bright blue"] then
  72. p = game.Players:GetPlayers()
  73. for i = 1,#p do
  74. if p[i].TeamColor == BrickColor.new("Bright red") then
  75. p[i].TeamColor = BrickColor.new("Bright blue")
  76. nump["Bright red"] = nump["Bright red"] + 1
  77. nump["Bright blue"] = nump["Bright blue"] - 1
  78. break
  79. end
  80. end
  81. end
  82. until
  83. nump["Bright red"] - nump["Bright blue"] <= 1 and nump["Bright blue"] - nump["Bright red"] <= 1
  84. end
  85.  
  86. function ResetTeams()
  87. for _,v in pairs(game.Players:GetPlayers()) do
  88. if v.TeamColor ~= BrickColor.new("Bright violet") then
  89. v.TeamColor = BrickColor.new("Bright green")
  90. end
  91. end
  92. end
  93.  
  94. trainers = {"SilentSwords","owen0202","supermansdog","Basketsgolba","drako72","Basketsgolba","AmazingAnt","Prometherion","dizzdazz4","Lucario1611","donut222","WIJPromotions","WIJManagement","cj10127","BallinOHehir21","lupine","yoshislayer","cymru792","cymru72","iRykorz","Daugion","Eeyore19718","JuHDude","Bloxmaster998144","shotsoon","Encladeus","piepiechris","Ultimateguy","Rovert10","dakotag11","STAInstructor","neo1014131","sk8rboy179","greekdagreat","bioniclehero","scaryblokhead","jack0800","LavaRocks894","ROBLOCKSuser","tallconnor123","KillerWarewolf","LORDORKY","wuppii","7035"}
  95.  
  96. function onPlayerEntered(newPlayer)
  97. for i = 1,#trainers do
  98. if newPlayer.Name == trainers[i] then
  99. newPlayer.Chatted:connect(function(text,recep) onChat(text,recep,player) end)
  100. end
  101. end
  102. end
  103.  
  104. game.Players.PlayerAdded:connect(onPlayerEntered)
Add Comment
Please, Sign In to add comment