From the ||arrays:add value to end|| drop-down menu, select warp_array as the array you want to add values to.To save locations into our array, you will want the save command to add the current position to the end of our array when we call it.įrom ||player:PLAYER||, drag another ||player:on chat command|| to the Workspace.įrom ||arrays:ARRAYS||, drag ||arrays:add value to end|| into ||player:on chat command "save"||. In ||player:say||, enter a message, for example, "Array deleted". Right-click the existing ||variables:set|| in ||loops:on start|| and select Duplicate.ĭrag this new ||variables:set|| block into ||player:on chat command "delete"||.įrom ||player:PLAYER||, drag a ||player:say|| after ||variables:set||. When you “delete” the array, you simply want to set it to an empty array so you are deleting the array’s contents.įrom ||player:PLAYER||, drag an ||player:on chat command|| onto the Workspace. Now, let’s create a command to delete our array. You should see the title change to ||arrays:create empty array||. In ||arrays:create array with||, click the minus sign (–) to empty it. Now let’s set ||variables:warp_array|| to a new array.Ĭlick the Advanced tab in the Toolbox to display ||arrays:ARRAYS||.įrom ||arrays:ARRAYS||, drag ||arrays:create array with|| into the ||variables:set "warp_array" to||. Name this variable warp_array, and click Ok.įrom ||variables:VARIABLES||, drag a ||variables:set|| into the ||loops:on start||.įrom the ||variables:set|| drop-down menu, select the warp_array variable. Open ||variables:VARIABLES|| and Make a Variable. List: This command prints all the positions in the array, with their index numbers.Ĭreate a new MakeCode project called Warp.įrom ||loops:LOOPS||, drag a ||loops:on start|| block onto the coding Workspace.Warp: This command, when entered with a number, teleports the player to the position stored at that index in the array.Save: This saves your current position to the next empty spot in the array.Delete: This creates an empty array, effectively deleting your old one.You’ll support four main commands in this program: You might use this to first locate things, teleport there, and then save the locations in your warp belt!įor example, to find a mansion in a world, enter the following: /locate mansion You can then enter in any structure you might want to find in the world you are in. In the chat window, enter ‘/locate’ followed by a space.
0 Comments
Leave a Reply. |