Mxnuscript Posted March 31, 2021 Share Posted March 31, 2021 Quote every 5 minutes: loop all blocks: if loop-block is a chest or trapped chest: set {_chest} to loop-block if inventory of {_chest} contains white dye: set {_ca} to amount of white dye in inventory of {_chest} loop 108 times: if {_ca} is greater than or equal to 32: add 1 white dye named "&fCompacted White Dye" to inventory of {_chest} remove 32 white dye from {_chest}'s inventory else: stop loop This is what I have, however, it does not work and I am not sure as to why. My plan is that every 5 minutes, if a chest has at least 32 white dye, it would compact it into 1 compacted white dye. And if the chest were to have way more than 32 white dye, let's say 358, it would create 11 compacted white dye, and then leave the left over white dye in the chest. Does anyone know what I need to change in order to make it work like I want it to? Link to comment Share on other sites More sharing options...
_Tarna_ Posted March 31, 2021 Share Posted March 31, 2021 There is no such thing as loop all blocks. And even if that was a thing, that would be looping millions of blocks in loaded chunks. You could loop all players then loop all blocks in a certain radius around that player. Discord - tarna256 In-game name - _Tarna_ Website - https://tarna.dev Paste Site: https://paste.tarna.dev --------------------------------------------------------- [VIP] - 7/27/2020 Community Support - 7/8/20 - 11/3/20 Helper - 11/3/20 - 2/21/21 Moderator - 2/21/21 - 5/17/21 - 5/17/21 - 12/20/22 Moderator - 12/20/22 - now --------------------------------------------------------- Link to comment Share on other sites More sharing options...
Mxnuscript Posted March 31, 2021 Author Share Posted March 31, 2021 (edited) Quote every 5 minutes: loop all players: loop blocks in radius 50 of loop-player: if loop-block is a chest or trapped chest: set {_chest} to loop-block if inventory of {_chest} contains white dye: set {_ca} to amount of white dye in inventory of {_chest} loop 108 times: if {_ca} is greater than or equal to 32: add 1 white dye named "&fCompacted White Dye" to inventory of {_chest} remove 32 white dye from {_chest}'s inventory else: stop loop @_Tarna_ so something like this should work, or is there something I am missing? Edited March 31, 2021 by Mxnuscript Link to comment Share on other sites More sharing options...
_Tarna_ Posted March 31, 2021 Share Posted March 31, 2021 7 minutes ago, Mxnuscript said: @_Tarna_ so something like this should work, or is there something I am missing? 50 is still a lot of blocks to loop. that would still be looping hundreds of thousands of blocks depending on how many players are on. It would probably be better to add the location to a list variable in the on join event and loop that variable. Discord - tarna256 In-game name - _Tarna_ Website - https://tarna.dev Paste Site: https://paste.tarna.dev --------------------------------------------------------- [VIP] - 7/27/2020 Community Support - 7/8/20 - 11/3/20 Helper - 11/3/20 - 2/21/21 Moderator - 2/21/21 - 5/17/21 - 5/17/21 - 12/20/22 Moderator - 12/20/22 - now --------------------------------------------------------- Link to comment Share on other sites More sharing options...
Mxnuscript Posted March 31, 2021 Author Share Posted March 31, 2021 (edited) Quote It would probably be better to add the location to a list variable in the on join event and loop that variable. @_Tarna_ Oh okay, and how would I go about doing that? Sorry I am quite new to skript. Just a quick example would be great. Edited March 31, 2021 by Mxnuscript Link to comment Share on other sites More sharing options...
_Tarna_ Posted March 31, 2021 Share Posted March 31, 2021 31 minutes ago, Mxnuscript said: @_Tarna_ Oh okay, and how would I go about doing that? Sorry I am quite new to skript. Just a quick example would be great. on place of chest: add event-block's location to {chests::*} then do loop {chests::*} to loop all the chests you have placed. Discord - tarna256 In-game name - _Tarna_ Website - https://tarna.dev Paste Site: https://paste.tarna.dev --------------------------------------------------------- [VIP] - 7/27/2020 Community Support - 7/8/20 - 11/3/20 Helper - 11/3/20 - 2/21/21 Moderator - 2/21/21 - 5/17/21 - 5/17/21 - 12/20/22 Moderator - 12/20/22 - now --------------------------------------------------------- Link to comment Share on other sites More sharing options...
Mxnuscript Posted April 1, 2021 Author Share Posted April 1, 2021 (edited) Quote every 5 minutes: loop {chests::*}: set loop-block to {_chest} if inventory of {_chest} contains white dye: set {_ca} to amount of white dye in inventory of {_chest} loop 108 times: if {_ca} is greater than or equal to 32: add 1 white dye named "&fCompacted White Dye" to inventory of {_chest} remove 32 white dye from {_chest}'s inventory else: stop loop @_Tarna_So that is what I have however, I get the error; "There's no loop that matches 'loop-block' (line #: set {_chest} to loop-block')". Do you have any clue why this is happening or how I could fix it? Edited April 1, 2021 by Mxnuscript Link to comment Share on other sites More sharing options...
CoolProgrammer Posted April 1, 2021 Share Posted April 1, 2021 (edited) 6 hours ago, Mxnuscript said: @_Tarna_So that is what I have however, I get the error; "There's no loop that matches 'loop-block' (line #: set {_chest} to loop-block')". Do you have any clue why this is happening or how I could fix it? Skript doesn't know that the variable being looped is a block. Try changing loop-block to loop-value since you are looping through a variable and skript treats variables with loop-index and/or loop-value. Edit: Also, while you set {_chest}, try parsing it as a block, inventory or something similar. Edited April 1, 2021 by CoolProgrammer Hello there! If you're reading this, hope you're having a wonderful day! Feel free to contact me via Discord (CoolProgrammer#1920) for any help. My DMs are always open for help. You can also message via. forum messages for help. Also, don't hesitate to leave a like on my post if I helped you in any way. Link to comment Share on other sites More sharing options...
Mxnuscript Posted April 1, 2021 Author Share Posted April 1, 2021 @CoolProgrammer Quote every 5 minutes: loop {chests::*}: set {_chest} to loop-value-1 if inventory of {_chest} contains white dye: set {_ca} to amount of white dye in inventory of {_chest} loop 108 times: if {_ca} is greater than or equal to 32: add 1 white dye named "&fCompacted White Dye" to inventory of {_chest} remove 32 white dye from {_chest}'s inventory else: stop loop That is what I got, it loads into the server fine, however it has no effect. I just don't know what the problem is ugh haha Link to comment Share on other sites More sharing options...
Mxnuscript Posted April 4, 2021 Author Share Posted April 4, 2021 I still need help with this if anyone is able to do so, it still has no effect in game. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now