generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: OnUpdate

Previous Thread :: Next Thread 
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
20 Jul 2015 12:44 AM
Since data store onupdate isn't instant, is there another option that I can do that's instant?
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
20 Jul 2015 12:51 AM
The problem it isn't instant is because it takes time to get data from roblox about your datastore, so no
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
20 Jul 2015 12:52 AM
How about a while wait(1) do?

I can use getasync instead.
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
20 Jul 2015 12:54 AM
That would quickly disable your data stores and make it MUCH slower than it already is. What are you trying to accomplish using this?
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
20 Jul 2015 12:55 AM
Getting the player count of the servers of the places connected to my main place.

Trying to do a server list.
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
20 Jul 2015 12:57 AM
Well, I've attempted such things and they didn't work! So I used an alternative and decided to count the number of servers instead of players by keeping track of them with DataStores
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
20 Jul 2015 12:58 AM
Wait, how would you get the player count?
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
20 Jul 2015 12:59 AM
Right now im getting it by updating the data store for it whenever a player joins or leaves.
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
20 Jul 2015 12:59 AM
I'm not sure you can or how if you can. I know there is a way somewhere depending on how often you need to check. What are you checking for?
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
20 Jul 2015 01:01 AM
Im checking for updating my server list at my main place.
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
20 Jul 2015 01:03 AM
Why not keep track of open servers instead of players?
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
20 Jul 2015 01:07 AM
Hmmm, how do you do that?
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
20 Jul 2015 01:11 AM
Make a DataStore called 'Servers'

Put a script in each game that adds a value to Servers when it starts.

Then when it ends (use game.OnClose) do the opposite.

In your main place you can get 'Servers' to see how many servers are running.

May want to shutdown your game before implementing just in case.
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
20 Jul 2015 01:12 AM
DO NOT use loops when accessing DataStores! It will destroy or greatly lag your DataStores!
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
20 Jul 2015 01:24 AM
That's exactly how im keeping track of the servers. I record the player count to see if there's a space or not.

Is there another way?
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
20 Jul 2015 01:30 AM
Yes, don't record the player account

Just put a server script in each of your places you want to count


Script:

DSS = game:GetService("DataStoreService")
DS = DSS:GetDataStore("Servers")

DS:UpdateAsync("Running", function(old) return old + 1 end)


function game.OnClose()
DS:UpdateAsync("Running", function(old) if old == 0 then return old end return old - 1 end)
end



Now to check your running servers, just look for

DataStore("Servers")
Async("Running")
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
20 Jul 2015 01:55 AM
Ok thanks!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image