Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to delete multiple specified items from a list
- PoppityTartitty
- Scratcher
3 posts
How to delete multiple specified items from a list
So, I'm using TurboWarp to code a survival scratch game that uses pen to generate world, and I'm currently working on crafting, which uses your inventory list.
The recipe for the pickaxe takes 3 Metal and 2 Wood. I got a script to delete one of each type of material, that works with deleting all instances with a different code off of the wiki, but there's one problem. When I use the script below, it only deletes one of the material, which is weird, because the deleting all instances code does the same thing, except it repeats it until there are no more of that item.
Can anyone help?
The recipe for the pickaxe takes 3 Metal and 2 Wood. I got a script to delete one of each type of material, that works with deleting all instances with a different code off of the wiki, but there's one problem. When I use the script below, it only deletes one of the material, which is weird, because the deleting all instances code does the same thing, except it repeats it until there are no more of that item.
repeat (2)
delete ( item # of Wood in Inventory) of [ Inventory]
end
repeat (3)
delete ( item # of Flint in Inventory) of [ Inventory]
end
Can anyone help?
Last edited by PoppityTartitty (Dec. 1, 2021 23:26:55)
- PoppityTartitty
- Scratcher
3 posts
How to delete multiple specified items from a list
Ok, I think I figured it out, I accidentally called the Metal flint.
I think I play too much don't starve
I think I play too much don't starve
- Discussion Forums
- » Help with Scripts
- » How to delete multiple specified items from a list