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

Is it possible to get players at bindtoclose?

Asked by 4 years ago
game:BindToClose(function()

    for i,v in pairs(game.Players:GetPlayers()) do
        print(i,v)
    end

    wait(30)


end)

nothing in the output bruh

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

EDIT: I think your real problem may be how you're testing this. Player add, remove, and BindToClose do not function the same in Studio as with a live server, you have to test BindToClose code with a live place, console open, and "Shut Down All Servers". print statement output can be delayed when you have a long yield, but you should still see this print. Throwing in a shorter duration way ahead of the wait(30) may get it to print a bit quicker.

No output is expected in Play Solo. The play solo datamodel cleanup is very different from what happens to a live server instance.

Ad

Answer this question