for i,v in pairs(game.Players:GetPlayers()) do if v.Name == hit.Parent.Name then return end print(v.Name) end
Hi this was just an example. I wanted it to make it so that the loop would print everyone's name except for the one person who touched the brick. When I use return end, it just ends the loop altogether. Is there a way so that I can skip that one player while letting the loop continue on?
Your script will nearly work.
It may turn out there is an easier way to do this, but:
for i,v in pairs(game.Players:GetPlayers()) do if v.Name ~= hit.Parent.Name then print(v.Name) end end
It skips the one that it hits, but doesn't break the loop.