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: Save in player?

Previous Thread :: Next Thread 
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
01 Mar 2015 12:31 PM
Here is the script, does it look correct? Also can I save within the playerGui?


local one = game.Players.LocalPlayer.PlayerGui.inv1.Value.Value
local two= game.Players.LocalPlayer.PlayerGui.inv2.Value.Value
local three= game.Players.LocalPlayer.PlayerGui.inv3.Value.Value
local four= game.Players.LocalPlayer.PlayerGui.inv4.Value.Value
local five= game.Players.LocalPlayer.PlayerGui.inv5.Value.Value

local DataStore = game:GetService("DataStoreService"):GetDataStore("Points")

local connection = DataStore:OnUpdate(oldvalue1, function(value)
local key = "user_" .. player.userId
local val1 = player.PlayerGui.Inv1.Value.Value
DataStore:UpdateAsync(key, function(oldvalue1)
local newValue1 = oldValue1 or {0,0,0,0,0}
newValue1 = {one,two,three,four,five}
return newValue1
end)
end)


"Think of the biggest number you can, you are worth more than that." -Seeumliam
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
01 Mar 2015 12:33 PM
Your function under OnUpdate will only run when the data is changed. The data is only changed in that function, meaning that data will never change.
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
01 Mar 2015 01:25 PM
I know I haven't added the part of when it updates, but can I run a save when the player leaves inside the playerGui?


"Think of the biggest number you can, you are worth more than that." -Seeumliam
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
01 Mar 2015 02:13 PM
How would I make it save say every 5 minutes? like while wait(200) do and then put the function after it?


"Think of the biggest number you can, you are worth more than that." -Seeumliam
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
01 Mar 2015 05:18 PM
bump


"Think of the biggest number you can, you are worth more than that." -Seeumliam
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
01 Mar 2015 06:08 PM
bump


"Think of the biggest number you can, you are worth more than that." -Seeumliam
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
01 Mar 2015 09:38 PM
bump


"Think of the biggest number you can, you are worth more than that." -Seeumliam
Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
01 Mar 2015 10:10 PM
Also the way your saving it everyone will have the same value.
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
01 Mar 2015 10:15 PM
How would I save it so everyone gets there own save?


"Think of the biggest number you can, you are worth more than that." -Seeumliam
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
02 Mar 2015 09:52 AM
Aren't I saving it to the persons username?


"Think of the biggest number you can, you are worth more than that." -Seeumliam
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
02 Mar 2015 03:21 PM
bump


"Think of the biggest number you can, you are worth more than that." -Seeumliam
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
02 Mar 2015 06:26 PM
bump


"Think of the biggest number you can, you are worth more than that." -Seeumliam
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
02 Mar 2015 06:32 PM
That is a really poor way to handle saving/loading and all the other fun stuff.

Try my Module in my libraries and create your own based off it if u will.

http://www.roblox.com/My/Sets.aspx?id=1453358
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