Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Got a script that needs fixing for my group help?

Asked by 8 years ago

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
0
To put into better terms when there's 20 raiders and for example say one leaves the script will still think there's 20 raiders. SteeIheads 0 — 8y

1 answer

Log in to vote
0
Answered by
joalars2 107
8 years ago
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.

Ad

Answer this question