Jump to content

place blocks gen. server


g1ps

Recommended Posts

Hello, how to make it so that the player can place blocks when the maximum limit is reached ?
It's impossible now.

on place:
  if player does not have permission "gen.admin":
    if searchcap(player) <= gensize(player):
      cancel event
      send "&cYou cannot place more than %searchcap(player)% &cgens" to player
  event is not cancelled
  set {_n::*} to split (uncoloured line 1 of lore of tool of player) at " "
  set {_n} to toNumber({_n::2})
  {_n} is set
  set {gen::%uuid of player%::%{_n}%::*} to {gen::%uuid of player%::%{_n}%::*} and location of event-block
 

 

Link to comment
Share on other sites

14 minutes ago, g1ps said:

Hello, how to make it so that the player can place blocks when the maximum limit is reached ?
It's impossible now.


on place:
  if player does not have permission "gen.admin":
    if searchcap(player) <= gensize(player):
      cancel event
      send "&cYou cannot place more than %searchcap(player)% &cgens" to player
  event is not cancelled
  set {_n::*} to split (uncoloured line 1 of lore of tool of player) at " "
  set {_n} to toNumber({_n::2})
  {_n} is set
  set {gen::%uuid of player%::%{_n}%::*} to {gen::%uuid of player%::%{_n}%::*} and location of event-block
 

 

Currently you are telling the code to look at ALL of the blocks and have a max size for it. If you limit it so it will only look at the specific blocks that are gens, it should work. Example: if the gens are pumpkin, melon, and glass, you would use

on place of pumpkin, melon, or glass:

hope this helps!

  • Like 1

If I have helped you out in your post or you liked what I posted, please upvote and react to my post! It helps me a lot!

Some Minehut Links:

Server Rules • Staff Applications • News & Updates • Reports • Appeals


Minehut: VIP (07/04/2021 --> Current)
Elestra/Versa Realms: Manager (12/04/2021 --> Current)

If you have any questions contact me!
My Discord: BanditEagle#2481
My Spigot Profile: https://www.spigotmc.org/members/banditeagle.935281/
My IGN: BanditEagle

Link to comment
Share on other sites

4 minutes ago, BanditEagle said:

Currently you are telling the code to look at ALL of the blocks and have a max size for it. If you limit it so it will only look at the specific blocks that are gens, it should work. Example: if the gens are pumpkin, melon, and glass, you would use


on place of pumpkin, melon, or glass:

hope this helps!

 

Thank you !

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...