Discord
Login
Community
DARK THEME

How do i make that it saves?

      if keyboard.press.SPACE then
        lastblock += 1
        name = "block" + lastblock
        if sblock == "tile1" then
          blocks[name] = Quick.addMap("tile1", player.x, player.y - 20, 20, 20)
        elsif sblock == "tile2" then
          blocks[name] = Quick.addMap("tile2", player.x, player.y - 20, 20, 20)
        elsif sblock == "tile3" then
          blocks[name] = Quick.addMap("tile3", player.x, player.y - 20, 20, 20)
        elsif sblock == "tile4" then
          blocks[name] = Quick.addMap("tile4", player.x, player.y - 20, 20, 20)
        end
        
        
      end

i want it to save the blocks and when you load in the game again it will load the level (blocks)

Microstudio has a storage API, using storage.set(name,data), the name is a string that you use to, well reference what your storing, like name it (yes, I know I don't know what I'm saying, but I don't know what to say...), and the data that you can store should numbers, stings, lists, and objects, and you use storage.get(name) to get the data using the same string you used before, it results in 0 if there is no data. You can look in the documentation if there is any info I forgot.

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community