Jump to content

Backpack


ReMask0

Recommended Posts

Works fine for me.

command backpack <text=small> <player=%player%>:
	permission: admin.bp
	permission message: &cInsufficient permissions!
	usage: &c/backpack <small/medium/large> [player]
	trigger:
		if arg-1 isn't "small", "medium" or "large":
			send "&c/backpack <small/medium/large> [player]"
			stop
		give arg-2 1st element of (chest named "&fSmall Backpack", chest named "&fMedium Backpack" and chest named "&fLarge Backpack" where [name of input in lowercase contains arg-1]) with lore "%(size of {backpack::%player's uuid%::*} ? 0) + 1%" and player's uuid
		send "&aGave you a %arg-1 in lowercase% &abackpack!"

on place of chest:
	cancel event if player's tool's name ends with " Backpack"

on right click holding chest:
	stop if player's tool's name doesn't end with " Backpack"
	stop if line 2 of player's tool's lore isn't player's uuid
	cancel event
	set metadata value "bp" of player to line 1 of player's tool's lore
	set {_size} to (1 if player's tool's name starts with "&fSmall ", else 3) if player's tool's name doesn't start with "&fLarge "
	set {_} to chest inventory with ({_size} ? 6) rows named player's tool's name
	loop {backpack::%player's uuid%::%line 1 of player's tool's lore%::*}:
		set slot loop-index parsed as int of {_} to loop-value
	open {_} to player

on inventory close:
	stop if metadata value "bp" of player isn't set
	set {_} to metadata value "bp" of player
	set {backpack::%player's uuid%::%{_}%::*} to all items in event-inventory
	delete metadata value "bp" of player

 

VIP since January 7th, 2020

Support since September 19th, 2020

Helper since November 3rd, 2020

Moderator since March 8th, 2021

unknown.png

5.png.e14b1bf83edf0ac2edc1bfb822177184.png

image.png.fe30b7b2c0be5a541ba4ed2187b23030.png

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...