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

how to use script to reset the world to original state? [closed]

Asked by 4 years ago
Edited 4 years ago

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?

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... Robloxian_Hero1234 14 — 4y
1
This is Scripting Helpers, not Roblox Support. DeceptiveCaster 3761 — 4y
0
i have a template place, that is "unchanged form", how can i "reinserting your original place and making them spawn"? TomAndelson 258 — 4y
0
just keep the workpace beforehand in the server storage, the delete the destryed one and replace Fad99 286 — 4y

Locked by User#24403

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 4 years ago

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)

Ad