Hi.
So, I am trying to give a player one pass if they are on the same team as another player. I have two object values (both stored inside a part, soccer/football ball that you can kick).
One is the previous network owner of the ball, and one is the current network owner of the ball. Is there any way I could check if they are on the same team?
Current script I have:
if ball.Owner.Value ~= player then
ball.OldOwner.Value = ball.Owner.Value
ball:SetNetworkOwner(player)
ball.Owner.Value = player
local old = ball.OldOwner.Value -- this stores a players name
local new = ball.Owner.Value -- this also stores a players name
if old.TeamColor ~= new.TeamColor then
old:FindFirstChild("Leaderstats").Passes.Value +=1
end
Any help would be appreciated, thanks!