|
| 18 Apr 2013 05:36 PM |
Well, I guess you can guess what I'm going to be asking about based on the title. If you've played any Zelda game you'll understand...
Essentially, I want to create a save/load data system with 3 'files'. I'm hoping to be able to do it in GUI form.
Currently I AM using a Leaderboard script to control a majority of everything that happens. This is the script:
function onPlayerEntered(newPlayer) wait(.03) local stats = Instance.new("IntValue") stats.Name = "leaderstat"
local cash = Instance.new("IntValue")
local mun = Instance.new("IntValue")
local Wallet200 = game.Workspace.Wallet200
cash.Name = "Rupees" cash.Value = 0 mun.Name = "WalletSize" mun.Value = 99
cash.Changed:connect(function() if cash.Value <= 0 then cash.Value = 0 newPlayer.PlayerGui.Rupees.Frame.MoneyCounter.TextColor3 = script.RupeeA.Value end if cash.Value >= mun.Value then cash.Value = mun.Value newPlayer.PlayerGui.Rupees.Frame.MoneyCounter.TextColor3 = script.RupeeB.Value end if cash.Value < mun.Value and cash.Value > 0 then newPlayer.PlayerGui.Rupees.Frame.MoneyCounter.TextColor3 = script.RupeeC.Value end end)
Wallet500.Touched:connect(function() if mun.Value > 99 then return end if mun.Value <= 99 then mun.Value = 200 newPlayer.PlayerGui.Rupees.Frame.MoneyCounter.TextColor3 = script.RupeeC.Value end end)
mun.Parent = stats cash.Parent = stats stats.Parent = newPlayer
end
game.Players.ChildAdded:connect(onPlayerEntered)
How would I transform this into a majestic save script? Explaining it to me or any help at all would be most appreciated... I can also provide any additional scripts I'm using, and explain certain values, such as the 'script.RupeeA' mentioned.
|
|
|
| Report Abuse |
|
|
dekkonot
|
  |
| Joined: 22 Dec 2010 |
| Total Posts: 6685 |
|
|
| 18 Apr 2013 05:37 PM |
| I'd reccomend you add it to a table then use JSON to save it in a string. |
|
|
| Report Abuse |
|
|
|
| 18 Apr 2013 05:39 PM |
Any chance you could explain further?
I don't really know much about most things in scripting, like tables, and etc. |
|
|
| Report Abuse |
|
|
dekkonot
|
  |
| Joined: 22 Dec 2010 |
| Total Posts: 6685 |
|
|
| 18 Apr 2013 05:40 PM |
| Insert an object into a player, or do some other way of marking that the player got said object. Then when it comes time to save load if each object exists into a table then load the RbxLibrary and use EncodeJSON on the table. |
|
|
| Report Abuse |
|
|
|
| 18 Apr 2013 05:41 PM |
| http://wiki.roblox.com/index.php/JSON |
|
|
| Report Abuse |
|
|
|
| 18 Apr 2013 05:45 PM |
| Just when you think everything is getting easier.... :U |
|
|
| Report Abuse |
|
|