Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Save player bricks to the game?

Asked by 8 years ago
Edited 8 years ago

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)

0
You can save the place periodically if you give each person their own place. GoldenPhysics 474 — 8y
0
Not what I'm looking for, but thanks for trying! TheGreatGoryGamer 20 — 8y
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. TheGreatGoryGamer 20 — 8y

1 answer

Log in to vote
0
Answered by
Kurieita 125
8 years ago

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

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 TheGreatGoryGamer 20 — 8y
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. TheGreatGoryGamer 20 — 8y
Ad

Answer this question