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

How do I make map-based resource collection/inventory tracking?

Asked by 5 years ago

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.

0
you forgot to put "local" before model, messageText, message and backup Theroofypidgeot 21 — 5y
0
Don't listen to him. You don't need to add local Audiimo 105 — 5y

Answer this question