game.Workspace.ChildAdded:Connect(function(added)
	
	if added:FindFirstChild("Code").Value == "MapNo3" or "MapNo2" or "MapNo1" then
		print("Map is succesfully generated")
		
		local players = game.Players:GetPlayers()
		wait(15)
		for i,v in pairs(players)do
						
		end
		
	else
		warn("Error ")
	end

end)

3 comments

0

It loops through all of them already.

0

for i,v so v is the "object" so for example print(tostring(v)) would print their name

0

you are already looping in the line 8 to , the player is the v so for example if you want to kick a player you will type inside the loop:                                                   ~~~~~~~~~~~~~~~~~                                                                                                                             for i,v in pairs(players) do