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 » Scripting Helpers
Home Search
 

Re: Small question

Previous Thread :: Next Thread 
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
21 Aug 2014 10:10 PM
Is using remote functions to access data stores and save player data efficient? Like, if the server were to be invoked by two people at the same time, would it glitch?
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
21 Aug 2014 10:27 PM
1
Report Abuse
vectorGunner is not online. vectorGunner
Joined: 23 Mar 2014
Total Posts: 784
21 Aug 2014 10:39 PM
I don't see any reason to use a remote function to access data stores. But no, it shouldn't have a problem.
Report Abuse
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
21 Aug 2014 10:45 PM
@vector
The point of RemoteFunctions/Events is to communicate between the server and client
Report Abuse
vectorGunner is not online. vectorGunner
Joined: 23 Mar 2014
Total Posts: 784
21 Aug 2014 10:55 PM
Apparently you can't read. I didn't say I didn't know what remote functions did. I just didn't see a purpose to use for datastores.
Report Abuse
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
21 Aug 2014 11:50 PM
dang son tone down the sass i aint mean no disrespect

Seriously though I meant that if you needed to access a data store through the client you'd need a RemoteFunction to do it for you because GetDataStore only works server-side
Report Abuse
AmericanRecords is not online. AmericanRecords
Joined: 01 Sep 2013
Total Posts: 47
22 Aug 2014 01:30 AM
scrubs
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
22 Aug 2014 01:48 AM
You can do that or you could create a metatable on the server's global table and access that from the client.
This way, the actual sensitive data never becomes client-controlled, so you can prevent CE exploiting.
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
22 Aug 2014 02:06 AM
To access it, we could try something like this:

SERVERSIDE

metadata = {
__call = function(table, ...)
local args = {...};
local ds = game:GetService("DataStoreService"):GetDataStore("gdata"..args[1].userId);
return ds:GetAsync(args[2]);
end
};

local md = setmetatable(_G, metadata);

LOCAL ACCESS
local coinval = _G(game.Players.LocalPlayer, "Coins");
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
22 Aug 2014 02:20 AM
Ok thanks
Report Abuse
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
22 Aug 2014 03:31 PM
I thought _G on the server and _G on the client were two separate environments, no?
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
22 Aug 2014 03:53 PM
@nice; In normal lua, yes, but in RBX.lua, I believe the environment is shared.

this is a signature: pcall(function() print([[apparently this is a string]]) end)
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
22 Aug 2014 09:01 PM
@kot, they're actually separate in server and client, which is why they made remote objects, I believe.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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