truefire2
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 5330 |
|
|
| 25 Feb 2014 02:16 PM |
Hi, I'm creating a script of which players join the game then join the team which is losing. However, it doesn't seem to work. How do I fix this? There is no output.
local Plrs = game.Players
function checkTeams() local kills_r,deaths_r,kdr_r local kills_b,deaths_b,kdr_b for _, v in pairs(Plrs:GetPlayers()) do if v.TeamColor == BrickColor.new("Bright blue") then deaths_b = v:FindFirstChild("leaderstats") and v["leaderstats"]:FindFirstChild("Wipeouts") and v["leaderstats"]["Wipeouts"].Value + deaths_b kdr_b = (kills_b/deaths_b ~= 0 and deaths_b or 1) elseif v.TeamColor == BrickColor.new("Bright red") then deaths_b = v:FindFirstChild("leaderstats") and v["leaderstats"]:FindFirstChild("Wipeouts") and v["leaderstats"]["Wipeouts"].Value + deaths_r kdr_r = (kills_r/deaths_r ~= 0 and deaths_r or 1) end end return kdr_r,kdr_b end
Plrs.PlayerAdded:connect(function(plr) if Workspace.MapHolder:GetChildren()[1] then kdr_r,kdr_b= checkTeams() if kdr_r > kdr_b then plr.TeamColor = BrickColor.new("Bright red") plr:LoadCharacter() elseif kdr_b > kdr_r then plr.TeamColor = BrickColor.new("Bright blue") plr:LoadCharacter() end end end) |
|
|
| Report Abuse |
|
truefire2
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 5330 |
|
| |
|
| 25 Feb 2014 03:22 PM |
| run it with a lot of print('randomstuff') |
|
|
| Report Abuse |
|