Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Do you know any sources for learning about save-games?

I am making a game entitled "Square RPG," and as an RPG, the current location of the player, as well as the stats, should be saved. However, I have not found a good source for learning how to go about implementing a script to save. Is anyone aware of a good source to learn? Or, if it is not against the guidelines, can you perhaps teach me how yourself?

Many thanks, --Crystakyl.

2 comments

0

Here's my tutorial on DataStores usage as well. https://scriptinghelpers.org/questions/27426/how-to-use-datastores#30949

2 answers

i dont know if this will help you but this helped me start https://www.youtube.com/watch?v=VXcbZ2kurvk

2 comments

0

This is how I learned ^

0

However this video doesn't do much to teach you "how" or "why" it works. I would watch this video to make your save script then go the the guys links in the comments to figure out "why" and "how" the script you made works.

Message me on roblox > TriickXzoniQ for further questions. But how ever, i save my data in models or instances. For example, your making a rpg, you need to save; -Gold Currency -Xp Stats -Level * Progress*

I've set up my data save to work like so

Player >Model -- What exactly is being saved < >Gold --Number Value >Xp --Number Value >Level --Number Value

You can use data store so it saves >Model and all of it's contents, and loads it when a player joins. If the player does not have it however, it still loads it. Heres the script;

SavedFile = "File3" Server = "ServerSet1" function PlayerAdded(Player) Player:WaitForDataReady() if Player:LoadInstance(SavedFile) == nil then Instance.new("Model",Player).Name = "Stats" Instance.new("NumberValue",Player.Stats).Name = "Gold" Instance.new("NumberValue",Player.Stats).Name = "Xp" Instance.new("NumberValue",Player.Stats).Name = "Level" elseif Player:LoadInstance(SavedFile) ~= nil then Player:LoadInstance(SavedFile).Parent = Player print ('Player Had File') end end function PlayerRemoved(Player) Player:WaitForChild("Stats") Player:SaveInstance(SavedFile,Player.Stats) end game.Players.PlayerRemoving:connect(PlayerRemoved) game.Players.PlayerAdded:connect(PlayerAdded)

1 comment

0

That's data persistence.

This discussion is preserved as it was. New answers, comments, and votes are closed.