Hey, there!
I am currently working on an open-world sandbox game, and the main feature I want in it is being able to destroy parts of the map for building materials (and yes, I want the materials to be stackable). There will then be an inventory you can access with "e" where you can select what materials you want to build with. Also, after a match is complete, I want the map to regenerate without having to rejoin another server. I know how to regenerate a map, but I don't know if the script I have will interfere.
model = game.Workspace.map
messageText = "Regenerating map..."
message = Instance.new("Message")
message.Text = messageText
backup = model:clone()
while true do
wait(600)
message.Parent = game.Workspace
model:remove()
wait(4)
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
message.Parent = nil
end
Please let me know if my regen script will work and how to make a resource collector/inventory tracker.

2 comments
you forgot to put "local" before model, messageText, message and backup
Don't listen to him. You don't need to add local