Hello. I made a deathrun map with traps that only work once. I want the players to be able to play the game over, however. How can I make it so the map somehow destroys itself after the game is over but regenerate itself in its original state when the game starts up again? I can give info about the map and game as a whole if you need me to.
I know this is probably a really easy question to be asked and whatnot, but I couldn’t find any suitable tutorials on here, youtube, or the dev hub. If you find a good tutorial let me know, but any help would be greatly appreciated!
You can put the first version of the map in Server storage, and once you need the map, :Clone it and set its parent to Workspace. Once the game is over, you can :Destroy() it.
The map is created, played on, then destroyed. I put a wait() anyway but it didn’t work. It just got stuck on intermission and didn’t clone the map again. It would clone the map the first time but wouldn’t clone after being destroyed.
Place the map in serverstorage (make sure it’s all in one model/group), and clone it to the workspace each time you want to use it, then delete it when you don’t need to use it.
local Map = game.ServerStorage.MapNameHere
while true do
wait(10)
local Clone = Map:Clone()
Clone.Parent = game.Workspace
wait(5)
Clone:Destroy()
end
I don’t know for sure if that’d work, but I believe you’d do something like I just did - except you put it in the workspace when the round starts, destroy it when the round ends.
I don’t know what I did but I solved it. I guess I just needed to sharpen my knowledge of cloning and lighting and all that. Thank you all for your contributions!