Function ran based on team leaderboard

I can’t seem to figure this one out.

I have a leaderboard stat for Kills. It works just fine
I have 2 teams, red and blue
When players of each team kill, the kills add up to the team’s overall kill number of course

Pretend I wanted it to run a print statement

When team red or blue’s kill count adds up to 5 (Or any other set number), Print(“Team Red/Blue wins!”)

Can someone please help me with this?

2 Likes

here is a simple function to do this!

function addKill(teamName)
    team[teamName].kills = team[teamName].kills + 1
    if team[teamName].kills >= 5 then
        print(teamName .. " wins!")
    end
end
1 Like