Jump to content

Refill pot gui


pete_parker

Recommended Posts

So this is my gui and my cooldown

 

command /refill:
	permission: pot.refill
	permission message: no perms lol
	trigger:
		set {_waited} to difference between {a_use.%player%.lastused} and now 
		if {_waited} is less then 2 minutes:
			send "&7&l[&4&l ✟&7&l ]&c Wait %difference between 2 minutes and {_waited}% til using again"
			if {_waited} is greater then 2 minutes:
				set {_gui} to a new chest inventory with 6 row with name "Pot refill" 
				set {_filler} to 0
				loop 54 times:
					set slot {_filler} of {_gui} to splash potion of healing
					add 1 to {_filler}
				open {_gui} to player
 		
			
			

see idk why it wont work , but it might becuase im to tired  i just need to someone to proof check my work 


Error:
image.png.d0f8b32f160edd5cc38a819eef030025.png


Plugins :

image.png.f8791d54ebe0195144e2837f4ddb4993.png


Ik holograms isnt working but isnt the problem atm , idk what i should do diffly 

Link to comment
Share on other sites

12 hours ago, pete_parker said:

So this is my gui and my cooldown

 

command /refill:
	permission: pot.refill
	permission message: no perms lol
	trigger:
		set {_waited} to difference between {a_use.%player%.lastused} and now 
		if {_waited} is less then 2 minutes:
			send "&7&l[&4&l ✟&7&l ]&c Wait %difference between 2 minutes and {_waited}% til using again"
			if {_waited} is greater then 2 minutes:
				set {_gui} to a new chest inventory with 6 row with name "Pot refill" 
				set {_filler} to 0
				loop 54 times:
					set slot {_filler} of {_gui} to splash potion of healing
					add 1 to {_filler}
				open {_gui} to player
 		
			
			

see idk why it wont work , but it might becuase im to tired  i just need to someone to proof check my work 


Error:
image.png.d0f8b32f160edd5cc38a819eef030025.png


Plugins :

image.png.f8791d54ebe0195144e2837f4ddb4993.png


Ik holograms isnt working but isnt the problem atm , idk what i should do diffly 

try "smaller than"

also checking if its smaller than 2 minutes then checking if its greater than 2 minutes it probably not gonna work.

Or you can do this instead

 

command /refill:
	permission: pot.refill
	permission message: no perms lol
	cooldown: 2 minutes
	cooldown message: &cWait %remaining time% &cbefore using this command again!
	trigger:
		set {_gui} to a new chest inventory with 6 row with name "Pot refill" 
		set {_filler} to 0
		loop 54 times:
			set slot {_filler} of {_gui} to splash potion of healing
			add 1 to {_filler}
		open {_gui} to player

 

 

 

image.png.bc433d6489d70ad831075fe76809b993.png
 

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

4 hours ago, AgentGamerPro said:

try "smaller than"

also checking if its smaller than 2 minutes then checking if its greater than 2 minutes it probably not gonna work.

Or you can do this instead

 

command /refill:
	permission: pot.refill
	permission message: no perms lol
	cooldown: 2 minutes
	cooldown message: &cWait %remaining time% &cbefore using this command again!
	trigger:
		set {_gui} to a new chest inventory with 6 row with name "Pot refill" 
		set {_filler} to 0
		loop 54 times:
			set slot {_filler} of {_gui} to splash potion of healing
			add 1 to {_filler}
		open {_gui} to player

 

Thank you for trying to help 
but i got it lol 
my error was where it said
 

if {_waited} is less then a 2 minutes:

instead of "then a" you put "than 2 mins"

then i fixed it up and here is the full code : 
 

command /refill:
	permission: pot.refill
	permission message: no perms lol
	trigger:
		set {_waited} to difference between {refill.%player%.lastused} and now 
		if {_waited} is less than 2 minutes:
			send "&7&l[&4&l ✟&7&l ]&c Wait &d&l%difference between 2 minutes and {_waited}%&c til using again"
			stop
			
		
		
		set {_filler} to 0
		set {_gui} to a new chest inventory with 6 row with name "Pot refill"
		loop 54 times:
			set slot {_filler} of {_gui} to splash potion of healing
			add 1 to {_filler}
		open {_gui} to player
		set {refill.%player%.lastused} to now

 

  • Like 2
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...