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

How would I get the amount of a team's total kills?

Asked by 8 years ago

http://wiki.roblox.com/index.php?title=API:Class/Team/Score

This is deprecated, and I'd like to display the total amount of a team's kills on a GUI, so I'm all ears.

0
I think a team's score doesn't exist anymore. However, you can get the amount of stats a team has, like kills CoolJohnnyboy 121 — 8y
0
That's what I literally just asked how to do. Kobertum -2 — 8y
0
Whoops. Not really correctly. What you're going to have to do is insert a value where kills will be added up, and create a script (or modify one) where everytime a person on that team gets a kill, it is added the total team kills. CoolJohnnyboy 121 — 8y
0
*reading. And I'm not typing correctly either CoolJohnnyboy 121 — 8y
View all comments (4 more)
0
This isn't a request site. W'e're not here to make scripts for you. Scootakip 299 — 8y
0
I do not recall asking you to make a script for me, I do recall implying I needed a method to get a team's total amount of kills. I apologize for your incompetence. Kobertum -2 — 8y
0
OP wasn't requesting a script, he was wondering on how to do something. And I told him how he could do it. CoolJohnnyboy 121 — 8y
0
You would have to count them as the team kills people. Everytime a player on the team gets a kill, increment a team kill value. Reference said value later on. Goulstem 8144 — 8y

1 answer

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
8 years ago

If you want to get the sum of the kills of every player on a certain team, you can add the number of kills of every player on a certain team together.

function GetKills(teamcolor)
    local kills=0
    for _,v in pairs(game.Players:GetPlayers())do
        if v.TeamColor==teamcolor then
            local l=v:FindFirstChild("leaderstats")
            if l then
                local k=l:FindFirstChild("Kills")
                if k then
                    kills=kills+k.Value
                end
            end
        end
    end
    return kills
end
0
where is the team color there must I enter the team color? PPJASK 19 — 3y
Ad

Answer this question