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

Players land reset on leaving?

Asked by
Cuvette 246 Moderation Voter
8 years ago

Hey, so I've made a script that designates a player some land when they touch the gate. Everything on the land saves into a model when they leave and rejoin so they can carry on building. The land model gets names "Cuvette's House" in workspace or whatever their name is.

I'm just trying to work out the best way to reset that plot of land when that player leaves the server and obviously destroy everything on the plot of land without it saving over the player's data and leaving them with nothing when they rejoin.

If you got any ideas that would be great!

0
When you sah "best" do you mean simplest or lest laggy? User#5423 17 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Well, of coarse it would reset and the only way to do it is either saving it as a value and using data stores or saving it as an instance. You can check the API here for more information of saving it as an instance which is easier than saving it as a value and then using the data stores to store it: http://wiki.roblox.com/index.php?title=API:Class/Player/SaveInstance

0
The whole thing is already saved as an instance, i've got all of that sorted. I just need the instance to reset to default when a player leaves and not overwrite their building. Cuvette 246 — 8y
0
When you put the code in, do not put Player:SaveInstance("Model", game.Workspace.Model -Or wherever is your instance at), you should put Player:SaveInstance(game.Players.LocalPlayer.Name, game.Workspace.Model). The first part is a key which should be unique to each player as if it were a datastore, but it has to be a string such as the player's name. lazycoolboy500 597 — 8y
Ad

Answer this question