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
 

Data store question.

Previous Thread :: Next Thread 
matt1020304050 is not online. matt1020304050
Joined: 24 May 2008
Total Posts: 4475
17 Jan 2015 05:04 AM
So I've got a script in the workspace that either creates a data store if it doesn't already exist. Or loads a previously created one.

Anyways, besides that. I have a gui with a button that you click and it is supposed to save your values.


The below code is inside the button activated when you click it. But when I go online and click it the output says "Data store can't be accessed from client"
How can I get this too work properly. This is creating a table to save all the values inside a GUI btw.

script.Parent.MouseButton1Down:connect(function(clicked)


local p = game.Players.LocalPlayer


local DataStore = game:GetService("DataStoreService"):GetDataStore(p.userId)
local stats = p.PlayerGui.Stats:GetChildren()
local s1 = {}
for i=1,#stats do
local n = stats[i].Name
s1[n] = stats[i].Value
end
DataStore:SetAsync("Stats",s1)
script.Parent.Text = p.PlayerGui.Stats.Test1.Value
end)
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
17 Jan 2015 05:05 AM
Don't use a LocalScript.
Report Abuse
matt1020304050 is not online. matt1020304050
Joined: 24 May 2008
Total Posts: 4475
17 Jan 2015 02:43 PM
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