Jump to content

Command with a pasword


Lapzzo

Recommended Posts

How can I add a pasword to this skript? Ive tried something like 

command /repair <player> <number>
  trigger:
      if arg-2 is 10:
          # Do stuff

But it wont work. Heres the skript

# Skript made by NotKaizo, Thanks NotKaizo -Lapzzo
options:
	balance: {coins::%player's uuid%} 
	repair_cost: 50 

command /repair <player>:
	usage: &cIncorect usage!
	trigger:
		if arg-1 is set:
			open inventory of arg-1 to player
			set {activeGui::%player's uuid%} to "inventoryGui"
			play sound "block.note_block.pling"  to player
			send "&aPlease click an item to repair it for 50 Coins!" to player
		else:
			send "e" to player

on inventory click:
	{activeGui::%player's uuid%} = "inventoryGui"
	cancel event
	set {_dura} to max durability of clicked item
	set {_fix} to durability of clicked item
	if {_fix} < {_dura}:
		if {@balance} >= {@repair_cost}:
			remove {@repair_cost} from {@balance}
			repair clicked item
			play sound "block.note_block.pling" to player
		else:
			play sound "entity.villager.no" to player
			send "&cYou do not have enough!"
	else if {_fix} >= {_dura}:
		play sound "entity.villager.no" to player

on inventory close:
	if {activeGui::%player's uuid%} is "inventoryGui":
		delete {activeGui::%player's uuid%}
		send "&cYou closed your inventory!"

 

 

imgonline-com-ua-resize-CNNkL1drx5M-removebg-preview.png.d6a8ae8b5eb862005fb056c21f934200.png

Link to comment
Share on other sites

  • 2 weeks later...

this might work...

  # Skript made by NotKaizo, Thanks NotKaizo -Lapzzo
options:
	balance: {coins::%player's uuid%} 
	repair_cost: 50 

command /repair [<player>] [<number>]:
	usage: &cIncorect usage!
	trigger:
		if arg-1 is set:
  			if arg-2 is "put password here":
				open inventory of arg-1 to player
				set {activeGui::%player's uuid%} to "inventoryGui"
				play sound "block.note_block.pling"  to player
				send "&aPlease click an item to repair it for 50 Coins!" to player
			else:
				send "&cWrong Password." to player

on inventory click:
	{activeGui::%player's uuid%} = "inventoryGui"
	cancel event
	set {_dura} to max durability of clicked item
	set {_fix} to durability of clicked item
	if {_fix} < {_dura}:
		if {@balance} >= {@repair_cost}:
			remove {@repair_cost} from {@balance}
			repair clicked item
			play sound "block.note_block.pling" to player
		else:
			play sound "entity.villager.no" to player
			send "&cYou do not have enough!"
	else if {_fix} >= {_dura}:
		play sound "entity.villager.no" to player

on inventory close:
	if {activeGui::%player's uuid%} is "inventoryGui":
		delete {activeGui::%player's uuid%}
		send "&cYou closed your inventory!"

or just...

command /repair [<player>] [<number>]:
	trigger:
		if arg-1 is set:
			if arg-2 is "put password here":
  				#do stuff
  			else:
  				send "&cWrong Password."

 

Edited by _Mr_Puppy_
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...