Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("TeamSetting Enabled I love you iRykorz")
- s1 = false
- s2 = false
- s3 = false
- s4 = false
- sd = false
- function onChat(text,recep)
- finaltext=string.lower(text)
- s1 = false
- s2 = false
- s3 = false
- s4 = false
- sX = false
- if string.find(finaltext, "computer")~= nil then
- s1 = true
- if string.find(finaltext, "randomise")~= nil then
- s2 = true
- end
- if string.find(finaltext, "teams")~= nil then
- s3 = true
- end
- if string.find(finaltext, "reset")~= nil then
- s4 = true
- end
- end
- if s4 == true then
- sX = true
- end
- if s1 == true and s2 == true and s3 == true and sX == false then
- Randomise()
- elseif s1 == true and s3 == true and sX == true then
- ResetTeams()
- end
- end
- function Randomise()
- local colors = {"Bright red","Bright blue"}
- nump = {
- ["Bright red"] = 0;
- ["Bright blue"] = 0;
- }
- for _,v in pairs(game.Players:GetPlayers()) do
- if v.TeamColor ~= BrickColor.new("Bright violet") or v.TeamColor ~= BrickColor.new("Dark stone grey") then
- r = math.random(1,2)
- v.TeamColor = BrickColor.new(colors[r])
- nump[colors[r]] = nump[colors[r]] + 1
- end
- end
- repeat
- wait()
- if nump["Bright red"] > nump["Bright blue"] then
- p = game.Players:GetPlayers()
- for i = 1,#p do
- if p[i].TeamColor == BrickColor.new("Bright red") then
- p[i].TeamColor = BrickColor.new("Bright blue")
- nump["Bright red"] = nump["Bright red"] - 1
- nump["Bright blue"] = nump["Bright blue"] + 1
- break
- end
- end
- elseif nump["Bright red"] < nump ["Bright blue"] then
- p = game.Players:GetPlayers()
- for i = 1,#p do
- if p[i].TeamColor == BrickColor.new("Bright red") then
- p[i].TeamColor = BrickColor.new("Bright blue")
- nump["Bright red"] = nump["Bright red"] + 1
- nump["Bright blue"] = nump["Bright blue"] - 1
- break
- end
- end
- end
- until
- nump["Bright red"] - nump["Bright blue"] <= 1 and nump["Bright blue"] - nump["Bright red"] <= 1
- end
- function ResetTeams()
- for _,v in pairs(game.Players:GetPlayers()) do
- if v.TeamColor ~= BrickColor.new("Bright violet") then
- v.TeamColor = BrickColor.new("Bright green")
- end
- end
- end
- 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"}
- function onPlayerEntered(newPlayer)
- for i = 1,#trainers do
- if newPlayer.Name == trainers[i] then
- newPlayer.Chatted:connect(function(text,recep) onChat(text,recep,player) end)
- end
- end
- end
- game.Players.PlayerAdded:connect(onPlayerEntered)
Add Comment
Please, Sign In to add comment