|
| 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 |
|
|
|
| 10 Feb 2016 05:05 PM |
300 robux goes to who solves it first
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
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 |
|
|
|
| 10 Feb 2016 07:35 PM |
ill pay 1k for someone to rescript that to data storage
|
|
|
| Report Abuse |
|
|
|
| 10 Feb 2016 08:39 PM |
It already uses DataStores though, the title was just misleading.
|
|
|
| Report Abuse |
|
|
| |
|