of     1   

DesignerDavid
#228411717Monday, December 04, 2017 2:03 AM GMT

what purpose did that serve? how inconsiderate of them smh. if you don't know what I'm talking about: http://wiki.roblox.com/index.php?title=API:Class/Players/NumPlayers&redirect=no
Negativize
#228411791Monday, December 04, 2017 2:05 AM GMT

can't you just do numPlayers = #game.Players:GetPlayers()
Vulkarin
#228411810Monday, December 04, 2017 2:05 AM GMT

because you can print it in one line who cares..
128Gigabytes
#228411910Monday, December 04, 2017 2:08 AM GMT

Its not gotten rid of its deprecated. Not the same thing. They shouldn't have in my opinion, it is more efficient to have it than it is to create a table with :GetPlayers() and then get the length of it. But whatever its not a huge difference.
Vulkarin
#228412216Monday, December 04, 2017 2:15 AM GMT

^ You can test it in-game and it's slower
128Gigabytes
#228412322Monday, December 04, 2017 2:18 AM GMT

There is no way I can imagine that being true, I'll test it in a minute.
128Gigabytes
#228412433Monday, December 04, 2017 2:20 AM GMT

#game.Players:GetPlayers() 1 million times takes 0.80861711502075 seconds game.Players.NumPlayers 1 million times takes 0.49134302139282 seconds
Negativize
#228412448Monday, December 04, 2017 2:21 AM GMT

'Its not gotten rid of its deprecated.' doesn't show up in player properties, u sure
Vulkarin
#228412474Monday, December 04, 2017 2:21 AM GMT

You have them in reverse...
128Gigabytes
#228412489Monday, December 04, 2017 2:22 AM GMT

I just did a test with it so yes I'm sure. Its a hidden property now.
JarodOfOrbiter
#228412512Monday, December 04, 2017 2:22 AM GMT

Why would something deprecated show up in the properties? Do you even know how many properties there are hidden from the properties window anyways? No, they deprecate things otherwise it would break every game in existence.
128Gigabytes
#228412557Monday, December 04, 2017 2:23 AM GMT

No, I don't have them reversed.
TheeDeathCaster
#228412594Monday, December 04, 2017 2:24 AM GMT

It might be because there's other ways of checking how many players are in a server. GetPlayers (could be) one of them. (One of the reasons I mean.) function NumPlayersInServer() return #Game:GetService('Players'):GetPlayers() end print(NumPlayersInServer()) -- How many players are in the server. To ROBLOX, `NumPlayers` may at this point be seen as redundant, and not a lot of use for it anymore. But that's just my guess as to why it was deemed deprecated.
JarodOfOrbiter
#228412601Monday, December 04, 2017 2:24 AM GMT

"You have them in reverse..." No, 128 is good at benchmarking. Besides, you're performing so many more operations with your version than by indexing a property.
Vulkarin
#228412651Monday, December 04, 2017 2:25 AM GMT

Oof I am only saying that because it was the opposite when I ran it but..........
JarodOfOrbiter
#228412692Monday, December 04, 2017 2:27 AM GMT

Oh sorry, that's on me I guess.
128Gigabytes
#228412746Monday, December 04, 2017 2:28 AM GMT

local tick = tick do local start = tick() for x = 1, 1000000, 1 do local _ = #game.Players:GetPlayers() end print(tick() - start) end do local start = tick() for x = 1, 1000000, 1 do local _ = game.Players.NumPlayers end print(tick() - start) end
Vulkarin
#228412920Monday, December 04, 2017 2:32 AM GMT

Oh I only did it one time...is that how you are supposed to do it?
JarodOfOrbiter
#228413026Monday, December 04, 2017 2:35 AM GMT

Nah, that's like trying to measure a sheet of paper. You can do it, but more likely the inaccuracies of your caliper are going to be the only thing you measure. Measure a whole ream and you can do it accurately with a tape measure. Do it millions of times to test, that way any minor random fluctuations in speed are negligible.
128Gigabytes
#228413129Monday, December 04, 2017 2:38 AM GMT

One call isn't going to give you much information to go on because the speed difference will be small and also since the speed can vary you get a more accurate test the more calls you do Also even with a single call directly referencing it should still be faster because its doing so much less, so even if you got reversed results I'm betting you probably actually got the scientific notation or whatever its called since the results would have been so small, and read it wrong. Here are the results of calling it once 1.1920928955078e-05 8.5830688476563e-06 Second one looks like a larger number but it actually is representative of a smaller number than the first represents
Exzeption
#228413442Monday, December 04, 2017 2:46 AM GMT

So does anyone know why they deprecated it?
JarodOfOrbiter
#228413462Monday, December 04, 2017 2:46 AM GMT

Again though, it takes fewer operations anyways. Here's what you get if you thumb through the bytecode. getglobal -- game gettable -- .Players self -- :GetPlayers call -- () len -- # getglobal -- game gettable -- .Players gettable -- .NumPlayers
JarodOfOrbiter
#228413562Monday, December 04, 2017 2:48 AM GMT

"So does anyone know why they deprecated it?" They're on a roll, deprecating things that don't quite match their style expectations. That's good, actually. As I've said for years, their API currently looks like it was written by fifteen interns that don't speak the same language, pushed to github at the same time and the conflicts randomly resolved until it was finished.
128Gigabytes
#228413671Monday, December 04, 2017 2:51 AM GMT

I wish they did camelCase though

    of     1