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: RemoteFunctions to get a table's data from datastore

Previous Thread :: Next Thread 
FrancisTWalker is not online. FrancisTWalker
Joined: 19 Oct 2013
Total Posts: 1911
23 Apr 2017 10:14 AM
How can I use RemoteFunctions to get a table I have from datastore?


Report Abuse
MiniNob is not online. MiniNob
Joined: 14 May 2013
Total Posts: 822
23 Apr 2017 10:18 AM
idc
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
23 Apr 2017 10:19 AM
Why


Report Abuse
KingAndrewofStuart is not online. KingAndrewofStuart
Joined: 31 Oct 2013
Total Posts: 2183
23 Apr 2017 10:23 AM
just cuz

i need the data for a gui


Report Abuse
GNUnotUNIX is not online. GNUnotUNIX
Joined: 05 Feb 2012
Total Posts: 15171
23 Apr 2017 10:26 AM
HttpService/JSON(Encode/Decode)
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
23 Apr 2017 10:34 AM
Those functions have literally nothing to do with this.

OP, post the code you already have.


Report Abuse
FrancisTWalker is not online. FrancisTWalker
Joined: 19 Oct 2013
Total Posts: 1911
23 Apr 2017 10:37 AM
the code's in 2 scripts

Basically, the 1st script makes a table based on a player's groups

game.Players.PlayerAdded:connect(function(Player)
local PlayerKey = "user_" .. Player.userId
local groupsTable = {}

if Player:IsInGroup(2898623) then
table.insert(groupsTable,"SISA")
end

DataStore:SetAsync(PlayerKey, groupsTable)
end)

2nd script, Im making in a GUI that uses the table to add buttons


Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
23 Apr 2017 10:39 AM
You're never reading the data that is saved.


Report Abuse
FrancisTWalker is not online. FrancisTWalker
Joined: 19 Oct 2013
Total Posts: 1911
23 Apr 2017 10:42 AM
i added this to the end of 1st to read it

local function sharetheTable()
game.Players.PlayerAdded:connect(function(Player)
local PlayerKey = "user_" .. Player.userId
local groupsTable = DataStore:GetAsync(PlayerKey)
HttpService:JSONDecode(groupsTable)
end)
end

ReplicatedStorage.TeamsDataStore.OnServerInvoke = sharetheTable()


Report Abuse
FrancisTWalker is not online. FrancisTWalker
Joined: 19 Oct 2013
Total Posts: 1911
23 Apr 2017 10:53 AM
in my GUI, how do I actually view the data from the InvokeServer?


Report Abuse
FrancisTWalker is not online. FrancisTWalker
Joined: 19 Oct 2013
Total Posts: 1911
23 Apr 2017 11:31 AM
b


Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
23 Apr 2017 11:32 AM
return table when remote function is invoked
Report Abuse
GNUnotUNIX is not online. GNUnotUNIX
Joined: 05 Feb 2012
Total Posts: 15171
23 Apr 2017 11:33 AM
#unsub
they can convert the table into a string and pass that string


Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
23 Apr 2017 11:34 AM
There's no reason to.


Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
23 Apr 2017 11:35 AM
tables can be returned but arrays are prioritized if there is also a dictionary part or you can return unpacked table data and compress it into a table on client
Report Abuse
FrancisTWalker is not online. FrancisTWalker
Joined: 19 Oct 2013
Total Posts: 1911
23 Apr 2017 11:47 AM
can I do this?

local groupsTable = TeamsDataStore:InvokeServer()



Report Abuse
FrancisTWalker is not online. FrancisTWalker
Joined: 19 Oct 2013
Total Posts: 1911
23 Apr 2017 11:49 AM
how would I return the table?


Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
23 Apr 2017 11:54 AM
yes

if you want it in function form

local function getData( ... )
return remote:InvokeServer( ... )
end
and there u go
the ... is there just in case u need any arguments sent
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