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

how to use script to reset the world to original state?

Hi there,

I need some help from everyone. I really appreciate it.

when I create a game, the workspace will be ruined after playing. I need to regenerate the place every 20 minutes or so. Initially I tried to create place dynamically, then I found out I cannot delete any place. then I tried to shut down the server from webpage, and the created places are still there!!!!

the only shut down server script I could find, is just kicking all players out in various ways.

so the only way I can think of, is if anyone knows I can reset the whole place, to the original state as the template place I define.

this is my game, at 0 minute, all players login, play 20 minutes or so, win or lose, all players kick out. the server reset/restart/regenerate, all game data wiped out. I went a long way create lobby, create place, create triggers to end the game. now the problem is I cannot shut down the place(all broken buildings, game data cleaning up). or does private server solve the problem?

4 comments

0

Creating a copy of the place in it's unchanged form then deleting everything e.g. nulling them and reinserting your original place and making them spawn...

1

This is Scripting Helpers, not Roblox Support.

0

i have a template place, that is "unchanged form", how can i "reinserting your original place and making them spawn"?

0

just keep the workpace beforehand in the server storage, the delete the destryed one and replace

1 answer

I think I figured out myself.

Don't use CreatePlaceAPI, it sounds cool in the API reference to create a place from template. So ideally you can duplicate the universe many times. No. that is not the purpose. It is for player to create his own private room for match making. So CreatePlace has only one sister function, SavePlace. YOU CANNOT DELETE ANY OF IT!

I end up creating reserve server from teleporting service, everytime it creates a new reserve server, all I need to do is teleport a group of player to that reserve server just created. In the next round, another server is created with another ID, and I teleport the players to another server and play a fresh new game.

the code is very simple,

serverID = TeleportService:ReserveServer(PlaceID)

then,

TeleportService:TeleportToPrivateServer(PlaceID, serverID, players)

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