can anyone point out the error with this code - it seems to be "grammatically" fine but when it runs i get the following error ""The Parent property of Map1 is locked, current parent: NULL, new parent Workspace""
yours - goku
local map = game.Workspace.Map1 map.Parent = game.ServerStorage local mapCopy = map:Clone() local mapCopy local function Regen() wait(6) mapCopy:destroy() mapCopy.Parent = game.Workspace wait(3) end mapCopy.Parent = game.Workspace while true do Regen() end
It was a little hard to read what your script exactly said due to it not being in code blocks but I believe the following code will do exactly what you are trying to do:
local StoredMap = game:GetService("ServerStorage").Map1 --//Location of stored map. local function Regen() wait(6) game.Workspace:FindFirstChild("Map1"):Destroy() --//Remove copy from Workspace. wait() local Copy = StoredMap:Clone() --//Clone copy from Server Storage. Copy.Parent = game.Workspace --// Insert new copy. end while true do Regen() --//Run the regen function. end