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: What do I change in this data persistance script so it saves

Previous Thread :: Next Thread 
ZedGamingYouTube is not online. ZedGamingYouTube
Joined: 22 Oct 2011
Total Posts: 14310
10 Feb 2016 05:02 PM
statsFile = game.ServerStorage.PlayerStats -- is a file
local datastore = game:GetService("DataStoreService"):GetDataStore("Stats")
local plrFile
local weaponFile
local sword1
local dagger1
local bow1
local bow2

game.Players.PlayerAdded:connect(function(plr)
--------------------- Files ---------------------
repeat wait() until plr.Character
plrFile = Instance.new("Folder",statsFile)
plrFile.Name = plr.Name
Points = Instance.new("IntValue",plrFile)
Points.Name = "Points"
weaponFile = Instance.new("Folder",plrFile)
weaponFile.Name = "WeaponFile"
Points.Value = datastore:GetAsync("Points"..plr.Name)
--------------------- Weapons ---------------------
sword1 = Instance.new("BoolValue",weaponFile)
sword1.Name = "Sword"
sword1.Value = true

dagger1 = Instance.new("BoolValue",weaponFile)
dagger1.Name = "Dagger"
dagger1.Value = true

bow1 = Instance.new("BoolValue",weaponFile)
bow1.Name = "Bow"
bow1.Value = datastore:GetAsync("Bow"..plr.Name)

bow2 = Instance.new("BoolValue",weaponFile)
bow2.Name = "Flame Bow"
bow2.Value = datastore:GetAsync("Flame Bow"..plr.Name)

end)


game.Players.PlayerRemoving:connect(function(leave)
datastore:SetAsync("Points"..leave.Name, Points.Value)

datastore:SetAsync("Bow"..leave.Name, bow1.Value)
datastore:SetAsync("Flame Bow"..leave.Name, bow2.Value)
end)




I basically need to save individual bool values in a file so if they are changed in a game to true/false it will be that value when they come back. thanks


Report Abuse
ZedGamingYouTube is not online. ZedGamingYouTube
Joined: 22 Oct 2011
Total Posts: 14310
10 Feb 2016 05:05 PM
300 robux goes to who solves it first


Report Abuse
ZedGamingYouTube is not online. ZedGamingYouTube
Joined: 22 Oct 2011
Total Posts: 14310
10 Feb 2016 05:28 PM
t2


Report Abuse
ZedGamingYouTube is not online. ZedGamingYouTube
Joined: 22 Oct 2011
Total Posts: 14310
10 Feb 2016 05:37 PM
t3


Report Abuse
ZedGamingYouTube is not online. ZedGamingYouTube
Joined: 22 Oct 2011
Total Posts: 14310
10 Feb 2016 05:43 PM
!!


Report Abuse
ZedGamingYouTube is not online. ZedGamingYouTube
Joined: 22 Oct 2011
Total Posts: 14310
10 Feb 2016 05:51 PM
sssss


Report Abuse
ZedGamingYouTube is not online. ZedGamingYouTube
Joined: 22 Oct 2011
Total Posts: 14310
10 Feb 2016 06:11 PM
wt


Report Abuse
ZedGamingYouTube is not online. ZedGamingYouTube
Joined: 22 Oct 2011
Total Posts: 14310
10 Feb 2016 06:30 PM
eee


Report Abuse
Notwal is not online. Notwal
Joined: 31 Dec 2014
Total Posts: 915
10 Feb 2016 07:22 PM
Data Persistence is decremented. Data Stores are so much easier.
Report Abuse
ZedGamingYouTube is not online. ZedGamingYouTube
Joined: 22 Oct 2011
Total Posts: 14310
10 Feb 2016 07:35 PM
ill pay 1k for someone to rescript that to data storage


Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
10 Feb 2016 08:39 PM
It already uses DataStores though, the title was just misleading.


Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
10 Feb 2016 08:43 PM
^
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