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

Save player bricks to the game?

I had recently included this in another question, but I'll explain it in more detail this time.

What I want to do for my game is to save a players bricks to the game. So say there were two players on my game. One is Bob and the other is Dave. They both built something and then ROBLOX went under maintenance and all servers went down. Normally their creations would be gone. But I want to make it so that there creations save. Not to the individual either. So Bob joined back and Dave didn't, Bob would be able to see both his and Dave's creation. Is this possible? I have found nothing like it. But if I were able to this my game would have to run on a individual server. Similar to the ROBLOX game "Meep City" (As I have stated this before)

3 comments

0

You can save the place periodically if you give each person their own place.

0

Not what I'm looking for, but thanks for trying!

0

Might just have to build my game on a Game Engine instead(I'd like to think of ROBLOX as a game engine but it has major limitations). It would be much more difficult though, so I'll continue looking for a while.

1 answer

Of course you can.

There are two ways to do as you stated. One of them is a bit outdated but it would get the job done. The other is more professional and a bit more complex. Shall we begin?

The first example we are going to be using Data Persistence.

--To save an instance
--Player:SaveInstance(Key, Value)

--To load an instance
--Player:LoadInstance(Key)
--So....

Game.Players.PlayerAdded:connect(function(Player)
Player:SaveInstance('Model', Workspace.Model)

wait(2)

local Model = Player:LoadInstance('Model')
Model.Parent = Workspace
end)

As I previous stated, this method is outdated.

Stravant wrote a module a while back that allow you to save instances to Roblox Datastore. I am not familiar with his module so I will post the example he uses.

https://www.roblox.com/EncodeInstance-Module-Does-not-work-with-CSG-item?id=176696010

dataStore:SetAsync("MyKey", EncodeInstance.Encode(someModel))

local someModel = EncodeInstance.Decode(dataStore:GetAsync("MyKey"))

I hope this help in some way. If it did feel free to thumb up. :)

-Kuri

2 comments

0

It helped a little. But still not what I'm looking for. Say if someone were to join my game after I created it. The world would be completely empty. If they built something it would stay there literally forever. So if this player left, the server would shut down. Then say two days later a DIFFERENT player joins. He will be able to see the previous players's creation. It is as if all the players

0

Last comment was too long... It is as if all the players are in RBLX Studio at the same time. And it auto saves often. Any brick a player creates is absolutely permanent.

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