No error I think it has to do with something on the PlayerGui line...
gps = game:GetService("GamePassService");
id = 166087748
VIP = {"Player1"}
players = game.Players:GetPlayers()
for i=1,#VIP do
for i=1,#players do
if players[i].Name == VIP[i].Name or gps:PlayerHasPass(players[i], id) then
players[i].PlayerGui.Gui.TextButton.Visible = true
else return end
end
end

3 comments
Still did not work
Get rid of .Name after VIP[v] as "Player1" is already a string. I will edit the script also to reflect some new changes.
Edited script, should work.