Statue is a part. Im trying to loop through the players and seeing if they have a value called RedTeam and if they do, then they can touch this "Statue" with there sword and when the sword touches it it will plus 1 a value, but the only thing as that I dont know what is wrong with this?
local Statue = script.Parent.Parent
for i,v in pairs (game.Players:GetPlayers()) do
local RedTeam = v:FindFirstChild("RedTeam")
Statue.Touched:Connect(function(hit)
if hit.Name == "Handle" and RedTeam then
script.Parent.Value = script.Parent.Value + 1
wait(3)
else
print("hey idot this is your own statue")
end
end)
end

2 comments
Did you check that the player has redteam?
Yes I did. The bool value appears in the player