So whenever we are raided the raider limit is broken so if they get 20 people then lose 5 they can't get another 5 people in. It stays stuck at 20 we only have 2 massive scripts at the fort but this is the portion of the raider limit script. All the variables and stuff are done correctly but here it is How do I fix this?
local Team = PlayerTeam(Player,1) if Team == "Fallen" then Player.TeamColor = Fallen[1] Fallen_Count.Value = Fallen_Count.Value + 1 Group.Value = true else if Raider_Count.Value < 20 then Player.TeamColor = Raider[1] Raider_Count.Value = Raider_Count.Value + 1 else Player:Kick("FALLEN ALERT: KICKED DUE TO RAIDER OVERLOAD") end end
game.Players.PlayerRemoving:connect(function(player) if Team == "Raider" then Raider_Count.Value = Raider_Count - 1 end end)
Should work. Unless i messed up the PlayerRemoving part.