Guest User

Untitled

a guest
Jan 24th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.53 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. sd = false
  7. function onChat(text,recep)
  8. finaltext=string.lower(text)
  9. s1 = false
  10. s2 = false
  11. s3 = false
  12. s4 = false
  13. sX = false
  14.     if string.find(finaltext, "computer")~= nil then
  15.     s1 = true
  16.     if string.find(finaltext, "randomise")~= nil then
  17.     s2 = true
  18.     end
  19.     if string.find(finaltext, "teams")~= nil then
  20.     s3 = true
  21.     end
  22.      if string.find(finaltext, "reset")~= nil then
  23.     s4 = true
  24.     end
  25.      end
  26.    
  27.     if s4 == true then
  28.     sX = true
  29.     end
  30.    
  31.     if s1 == true and s2 == true and s3 == true and sX == false then
  32.     Randomise()
  33.     elseif s1 == true and s3 == true and sX == true then
  34.     ResetTeams()
  35.     end
  36.    
  37. end
  38. function Randomise()
  39. local colors = {"Bright red","Bright blue"}
  40. nump = {
  41.     ["Bright red"] = 0;
  42.     ["Bright blue"] = 0;
  43. }
  44.     for _,v in pairs(game.Players:GetPlayers()) do
  45.         if v.TeamColor ~= BrickColor.new("Bright violet") or v.TeamColor ~= BrickColor.new("Dark stone grey") then
  46.         r = math.random(1,2)
  47.         v.TeamColor = BrickColor.new(colors[r])
  48.         nump[colors[r]] = nump[colors[r]] + 1
  49.         end
  50.     end
  51.     repeat
  52.     wait()
  53.         if nump["Bright red"] > nump["Bright blue"] then
  54.             p = game.Players:GetPlayers()
  55.             for i = 1,#p do
  56.                 if p[i].TeamColor == BrickColor.new("Bright red") then
  57.                 p[i].TeamColor = BrickColor.new("Bright blue")
  58.                 nump["Bright red"] = nump["Bright red"] - 1
  59.                 nump["Bright blue"] = nump["Bright blue"] + 1
  60.                 break
  61.                 end
  62.             end
  63.         elseif nump["Bright red"] < nump ["Bright blue"] then
Add Comment
Please, Sign In to add comment