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 » Scripting Helpers
Home Search
 

Re: Help? c:

Previous Thread :: Next Thread 
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
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 is not online. 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
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
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 is not online. 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
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
18 Apr 2013 05:41 PM
http://wiki.roblox.com/index.php/JSON
Report Abuse
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
18 Apr 2013 05:45 PM
Just when you think everything is getting easier.... :U
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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