weird chat tags error (it basically says i need a ')' to close a '(' even though i did close it)

The error says on line 57, a ) is expected to close the ( on line 26. Here are all of the lines between line 26 and 57

[lua]
hook.Add(“OnPlayerChat”, “Tags”, function(ply, Text, Team, PlayerIsDead)
if ply:IsValid() then
for k,v in pairs(Tags) do
if ply:IsUserGroup(v[1]) then
if ply:Team() == TEAM_PRISONER then
if ply:Alive() then
chat.AddText(Color(0, 204, 0, 255), "{TEAM} ", v[3], v[2], Color(50, 50, 50, 255), "| ", ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
else
chat.AddText(Color(255, 0, 0, 255), “DEAD”, Color(0, 204, 0, 255), "{TEAM} ", v[3], v[2], Color(255, 50, 50, 255), "| ", ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
end
end
return true
end
if ply:Team() == TEAM_GUARD then
if ply:Alive() then
chat.AddText(Color(0, 204, 0, 255), "{TEAM} ", v[3], v[2], Color(50, 50, 50, 255), "| ", ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
else
chat.AddText(Color(255, 0, 0, 255), “DEAD”, Color(0, 204, 0, 255), "{TEAM} ", v[3], v[2], Color(50, 50, 255, 255), "| ", ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
end
end
return true
end
if ply:IsPlayer() then
if ply:Alive() then
chat.AddText(Color(255, 0, 0, 255), “”, v[3], v[2], Color(50, 50, 50, 255), "| ", ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
return true
elseif !ply:Alive() then
chat.AddText(Color(255, 0, 0, 255), "DEAD ", v[3], v[2], Color(50, 50, 50, 255), "| ", ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
return true
end
end
end
end
end
end)
[/lua]

please note, i get the same exact error after adding another ), hell i could add 50 and it gives me the same error. Everything else (v[3], color_white, etc) is defined.

[editline]9th March 2016[/editline]

didnt feel like posting the error, but if u really want it - just ask. I am just saying, that is exactly what it says but revised

[lua]hook.Add(“OnPlayerChat”, “Tags”, function(ply, Text, Team, PlayerIsDead)
if ply:IsValid() then
for k,v in pairs(Tags) do
if ply:IsUserGroup(v[1]) then
if ply:Team() == TEAM_PRISONER then
if ply:Alive() then
chat.AddText(Color(0, 204, 0, 255), "{TEAM} ", v[3], v[2], Color(50, 50, 50, 255), "| ", ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
else
chat.AddText(Color(255, 0, 0, 255), “DEAD”, Color(0, 204, 0, 255), "{TEAM} ", v[3], v[2], Color(255, 50, 50, 255), "| ", ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
end
return true
end
if ply:Team() == TEAM_GUARD then
if ply:Alive() then
chat.AddText(Color(0, 204, 0, 255), "{TEAM} ", v[3], v[2], Color(50, 50, 50, 255), "| ", ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
else
chat.AddText(Color(255, 0, 0, 255), “DEAD”, Color(0, 204, 0, 255), "{TEAM} ", v[3], v[2], Color(50, 50, 255, 255), "| ", ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
end
return true
end
if ply:IsPlayer() then
if ply:Alive() then
chat.AddText(Color(255, 0, 0, 255), “”, v[3], v[2], Color(50, 50, 50, 255), "| ", ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
return true
elseif !ply:Alive() then
chat.AddText(Color(255, 0, 0, 255), "DEAD ", v[3], v[2], Color(50, 50, 50, 255), "| ", ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
return true
end
end
end
end
end
end)[/lua]

I think this is what you are trying to do

what did you change?

after the IsUserGroup statement up until the ply:IsPlayer() statement there were some out of place ends and returns.