drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
|
| 14 Jan 2014 09:33 PM |
yo i was making some saving jazz but then i realised i was terrible at it this scripts broken, do any of you folks know why? the goal of the save script is to when the button is pressed, save the contents inside "bought" and save the value of doge
the goal of load is to clear the contents of bought and replace them with the saved jazz and replace doge value with the saved one
not really sure what the problem is probably that i am awful at data persistance
Save: a = script.Parent.Parent.doge script.Parent.MouseButton1Up:connect(function() if n == nil then n = "obama" x = script.Parent.Parent.Parent.Parent.Parent x:WaitForDataReady() z = script.Parent.Parent.bought:GetChildren() x:SaveNumber("thebought", #z) for i, yolo in pairs(z) do pcall(function () x:SaveInstance(tostring(i), yolo) end) end x:SaveNumber("doges", script.Parent.Parent.doge.Value) script.Parent.Text = "saved" wait(1) script.Parent.Text = "save" n = nil end end)
Load: a = script.Parent.Parent.doge script.Parent.MouseButton1Up:connect(function() if n == nil then n = "obama" x = script.Parent.Parent.Parent.Parent.Parent x:WaitForDataReady() wipe = script.Parent.Parent.bought:GetChildren() for i, batman in pairs(wipe) do batman:remove() end local count = 0 pcall(function () count = player:LoadNumber("thebought") end) local z = {} for i = 1, count do pcall(function () z[#z + 1] = player:LoadInstance(tostring(i)) end) end for i, batman in pairs(z) do local copy = batman:clone() copy.Parent = script.Parent.Parent.bought end script.Parent.Parent.doge.Value = x:LoadNumber("doges") script.Parent.Text = "saved" wait(1) script.Parent.Text = "save" n = nil end end) |
|
|
| Report Abuse |
|
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
| |
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
| |
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
|
| 14 Jan 2014 10:53 PM |
b3 i see why people don't like dp |
|
|
| Report Abuse |
|
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
|
| 14 Jan 2014 11:11 PM |
b4 doesn't save/load items inside of bought |
|
|
| Report Abuse |
|
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
| |
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
| |
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
| |
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
| |
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 15 Jan 2014 02:15 AM |
wat u try to load/save btw And also I am on mobile so excuse my dumbness |
|
|
| Report Abuse |
|
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
|
| 15 Jan 2014 03:00 AM |
the universe someones items and someones money |
|
|
| Report Abuse |
|
|
|
| 15 Jan 2014 03:26 AM |
"the universe" <- but you're not actually using the universes data persistence API...
-Believe and you will achieve- |
|
|
| Report Abuse |
|
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
| |
|
| |
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
|
| 15 Jan 2014 05:07 AM |
so nobody wants to help? lovely |
|
|
| Report Abuse |
|
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
| |
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
|
| 15 Jan 2014 04:00 PM |
aka main problems (probably) in each x:WaitForDataReady() z = script.Parent.Parent.bought:GetChildren() x:SaveNumber("thebought", #z) for i, yolo in pairs(z) do pcall(function () x:SaveInstance(tostring(i), yolo) end) end
load: x:WaitForDataReady() wipe = script.Parent.Parent.bought:GetChildren() for i, batman in pairs(wipe) do batman:remove() end local count = 0 pcall(function () count = player:LoadNumber("thebought") end) local z = {} for i = 1, count do pcall(function () z[#z + 1] = player:LoadInstance(tostring(i)) end) end for i, batman in pairs(z) do local copy = batman:clone() copy.Parent = script.Parent.Parent.bought end
|
|
|
| Report Abuse |
|
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
| |
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
|
| 15 Jan 2014 07:08 PM |
so it looks like im never getting help whoopdedoo |
|
|
| Report Abuse |
|
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
|
| 16 Jan 2014 02:20 AM |
the items don't like loading but the savenumber and loadnumber work fine maybe im just overcomplicating the item system |
|
|
| Report Abuse |
|
|
OldGoldie
|
  |
| Joined: 17 Aug 2010 |
| Total Posts: 8210 |
|
|
| 16 Jan 2014 02:22 AM |
Not too fimilliar but i made a script to autosave tools from your backpack, you could try doing save and load instance for the "items" |
|
|
| Report Abuse |
|
|