So yeah, thanks for those who can help. Well, I was trying to do a gamemode, like that it counts how many kills the teams got in a gui, seperately. So there is the blue one and the red one. Red one shows how many kills the red team got, and the blue shows how many kills the blue team got, basically the same thing. So I had a script that only counts the player kills, not the teams. When I tried to add that it only counts how many the team has killed, I didn't really find a way, so here I am. Anyone could help? Also for those who say I'm new to scripting, no I'm not, but I never have come up making a gamemode. Also here's the script for the player kill counter
local player = game.Players.LocalPlayer local textlabel = script.Parent while wait() do textlabel.Text = player:WaitForChild("leaderstats"):WaitForChild("KOs").Value end
How should I edit to it work as I want it?
local myTeam = game.Teams.NinjaSquad -- Your team local groupcount = 0 for i,v in pairs(game.Players:GetChildren()) do if v.Team == myTeam then groupcount = groupcount + v.leaderstats.KOs.Value end end print(groupcount)
Try that.