Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is it possible to get players at bindtoclose?

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

✓ Accepted answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.