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

Is there a way to save the modified versions of the models in Replicated Storage to a player?

I am still fairly new to scripting, and had asked a question similar to this previously today, but the answer I had received wasn't exactly what I was looking for, and the question I had asked was more generalized on Data Storage for a game completely. This is for 1 specific part of data storage, and I'd like to understand more about the limitations of what Data Storage can do. The answer I had received on the previous question seemed to pertain to money, or exp, or a IntValue that could be saved to the player. So if the player left, they'd be able to have their leaderboard stats saved, and in the event of Roblox crashing, they'd be able to have their stats protected by a function called pcall(). This is a little different from that. This doesn't pertain to the player, as much as it pertains to the object that the player possesses in their saved storage.

I was looking to see if it is possible to save personalized models to a specific player character, and if specific values that were different from the original model that were in the personalized model could be saved, even if they weren't the same as the model in ReplicatedStorage.

Let me make it clear, I don't want the Original models in Replicated Storage to change, I just want the player's modified model to be saved to their profile in game.

Is this possible at all?

1 answer

✓ Accepted answer

You could likely create a folder containing BoolValues in the player that, when they get the tools in the game the BoolValue would be true, and should they not have it any more, it would be false.

You can use this code I made for you, though it doesn't handle changing the values.

-- made for scriptinghelpers.org

game.Players.PlayerAdded:Connect(function(player)
	local Folder = Instance.new("Folder")
	Folder.Name = "Items"
	Folder.Parent = player
	
	local exampleitem = Instance.new("BoolValue")
	exampleitem.Name = "Item"
	exampleitem.Paren = Folder
end)

That simple code can follow up by being saved and loaded the exact same way as the Levels or EXP that you talked about.

I will not provide code for the items, but will explain to the best of my ability.

You want to see when the item becomes true or false, and when it does you want to give the item to the player.

Example: Player buys sword, swords value becomes true, causing them to get the sword. Player leaves with sword, joins back the next day, and gets the sword once more.

~best regards, DetectiveRaie

2 comments

0

Thank you so much, that is exactally what I needed to fix one of my major problems with being able to save the bought models bought from the GUI up to the player.

0

I had to break your script up into 2 parts, due to the sheer amount of models that will be used in this process. The first part was put into a module script, and protected by a pcall line, the second part is used in each button script to buy the vehicles in question.

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