this script is only suppose to work if player is in team Red or Red2, however it still works if you're not on either team, anyone know why?
red = BrickColor.new("21")
red2 = BrickColor.new("1004")
function T(hit)
if (hit.Name == "SoccerBall") then
local plyr = game.Players:FindFirstChild(hit.Kicker.Value)
if plyr.TeamColor == red or red2 then
plyr.leaderstats.Overall.Value = plyr.leaderstats.Overall.Value + 0.04
plyr.hiddenstats.Goals.Value = plyr.hiddenstats.Goals.Value + 1
plyr.Pointz.Points.Value = plyr.Pointz.Points.Value + 1
hit.Position = script.Parent.Parent.Parent.Cage.CageFloor.Position + Vector3.new(0, 1.7, 0)
p = script.Parent.Parent.Parent.Cage:GetChildren()
for i = 1, #p do
p[i].BrickColor = red
end
wait(35)
workspace.whistle1:Play()
script.Parent.Parent.Parent.SoccerBall.Position = script.Parent.Parent.Parent.Pad.Position + Vector3.new(0, 1.7, 0)
for n = 1, #p do
p[n].BrickColor = BrickColor.new("194")
end
end
end
end
script.Parent.Touched:connect(T)

1 comment
Don't think that's the correct answer...