Pryzmm Posted March 26, 2021 Share Posted March 26, 2021 im trying to find out how many mobs there are in 1 area, but its thinking that loop-block-1 is a world? on spawn of a pig: loop all blocks in radius 4 around event-entity: if loop-block is spawner: cancel event set {_foundspawner} to true set {_spawnerloc} to location of loop-block-1 loop all blocks in radius 3 of loop-block-1: if loop-block-2 is air: if block above loop-block-2 is air: add loop-block-2 to {_spawnmobloc::*} loop all entitys in radius 9 of loop-block-1: if loop-entity is not a player: add 1 to {_counter} if {_counter} is greater than or equal to 5: broadcast "&cToo many mobs in 1 area!" stop else: ... Owner of Lifestealed, Labs, Encore, UNOfficially and Observed OG [VIP] 12/26/20 - 10/27/2021 OG [PRO] 12/27/21 - 11/18/2022 OG [LEGEND] 11/18/2022 - 3/14/2023 [DEFAULT] 3/14/2023 - 5/8/2024 [MOD] 5/8/2024 - Present Link to comment Share on other sites More sharing options...
_Tarna_ Posted March 26, 2021 Share Posted March 26, 2021 Are you just trying to stop mob from spawning if there is too many in that one area? Try using this. I got no errors with it but I haven't tested it so not sure if it works. on spawn of pig: set {_size} to amount of entities in radius 5 around event-location where [input is not a player] if {_size} > 5: cancel event broadcast "&cToo many mobs in 1 area!" 1 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 - now Moderator - 12/20/22 - now --------------------------------------------------------- Link to comment Share on other sites More sharing options...
Pryzmm Posted March 27, 2021 Author Share Posted March 27, 2021 (edited) 7 hours ago, _Tarna_ said: Are you just trying to stop mob from spawning if there is too many in that one area? Try using this. I got no errors with it but I haven't tested it so not sure if it works. on spawn of pig: set {_size} to amount of entities in radius 5 around event-location where [input is not a player] if {_size} > 5: cancel event broadcast "&cToo many mobs in 1 area!" so umm...Here my new skript: on spawn of a pig: loop all blocks in radius 4 around event-entity: if loop-block is spawner: cancel event set {_foundspawner} to true set {_spawnerloc} to location of loop-block-1 loop all blocks in radius 3 of loop-block-1: if loop-block-2 is air: if block above loop-block-2 is air: add loop-block-2 to {_spawnmobloc::*} set {_size} to amount of entities in radius 9 around loop-block-1 where [input is not a player] if {_size} > 5: broadcast "&cToo many mobs in 1 area!" stop else: ... i only want it to spawn like 2 zombies not 200.EDIT: I fixed it, i had to remove the "else:" Thanks @_Tarna_ Edited March 27, 2021 by AgentGamerPro Owner of Lifestealed, Labs, Encore, UNOfficially and Observed OG [VIP] 12/26/20 - 10/27/2021 OG [PRO] 12/27/21 - 11/18/2022 OG [LEGEND] 11/18/2022 - 3/14/2023 [DEFAULT] 3/14/2023 - 5/8/2024 [MOD] 5/8/2024 - Present 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