Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to loop through each and every player in the for loop in line 8 ?

Asked by 4 years ago
Edited 4 years ago
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)
0
It loops through all of them already. spunkworks 110 — 4y
0
for i,v so v is the "object" so for example print(tostring(v)) would print their name misha123 83 — 4y
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                                          dionsyran2 66 — 4y

Answer this question