Tornado Survival Round System Not Working

So recently I ran into a problem with my game, the problem that I currently have is that the game deletes the main map after 2 rounds and the script just stops. The current script I am using is this script below

local Status = game.ReplicatedStorage.Status

local clonedMap = workspace.Map:Clone()

local Tornado = game.ServerStorage.Objects.Tornado

local timeForGameToStart = 15
local timeToEndGame = 60

while true do
	wait(3)
	Status.Value = "Game starting soon"
	wait(timeForGameToStart)
	Status.Value = "Teleporting players..."
	local players = game.Players:GetPlayers()
	for i,plrs in pairs(players) do
		local plrName = plrs.Name
		local plrChar = workspace[plrName]
		plrChar:MoveTo(workspace.Map.TeleportPoint.Position + Vector3.new(0,5,0))
	end
	wait(3)
	Status.Value = "There seems to be a tornado forming soon"
	wait(4)
	Status.Value = "Try to seek shelter soon as this may be very dangerous"
	wait(10)
	Tornado.Parent = workspace.TornadoFolder
	Status.Value = "THE TORNADO HAS FORMED, EVERYONE SEEK SHELTER IMMEDIATELY"
	wait(timeToEndGame)
	Tornado.Parent = game.ServerStorage.Objects
	Status.Value = "It seems that the tornado is gone"
	wait(4)
	Status.Value = "It is now safe to exit your shelters now"
	wait(4)
	for i,plrs in pairs(players) do
		local plrName = plrs.Name
		local plrChar = workspace[plrName]
		plrChar.Humanoid.Health = 0
	end
	workspace.Map:Destroy()
	wait(3)
	clonedMap.Parent = workspace
	wait(5)
end

Also the error I get after the round and script is stopped is this
epicmapfail

I have tried switching some scripts around making the map get destroyed right when the game is about to start and clone it once the game starts but that doesn’t work.

If someone could help out that would be greatl

1 Like

The problem arises here

You move the cloned version to the workspace and never create a new cloned version. Once it gets around to the end of the second round, workspace.Map and clonedMap are references to the same instance and is Destroyed.

You should instead clone the clonedMap and set that value’s parent to the workspace. Much like this:

	workspace.Map:Destroy()
	wait(3)
	clonedMap:Clone().Parent = workspace
3 Likes