Jump to content

What is wrong with this skript?


_U4R1A_

Recommended Posts

Im making a /sell menu and it all goes wrong when it says "event-inventory is not a world"

yet if I set it to normal yellow dye, and not glowing, it works. What went wrong??

	if slot 9 or 10 or 11 or 12 or 13 or 14 or 15 or 16 of current inventory of player is glowing yellow dye named "&e&lUpgraded Sponge Remnant":
			set {_itemcounti} to number of all glowing yellow dye named "&e&lUpgraded Sponge Remnant" in event-inventory
			remove {_itemcounti} of glowing yellow dye named "&e&lUpgraded Sponge Remnant" from event-inventory
			add {@UspongeR} * {_itemcounti} to the player's balance
			send "&6You sold %{_itemcounti}% &eUpgraded Sponge Remnants. &e%{@UspongeR} * {_itemcounti}% &6was added to your wallet"

 

Link to comment
Share on other sites

Are you able to send the full skript for the command to see if other parts are causing it. Also glowing needs an addon. Think its skQuery so make sure you also have that. 

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

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

14 minutes ago, _Tarna_ said:

Are you able to send the full skript for the command to see if other parts are causing it. Also glowing needs an addon. Think its skQuery so make sure you also have that. 

ok here is the full skript, sorry if its a bit messy. I have TusKe and skQuery.

#UPGRADE GENS
on right click:
	if event-block is sponge:
		if player is sneaking:
			if player's balance > 4999:
				set event-block to wet sponge
				play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 to player
				remove 5000 from player's balance
			if player's balance < 4999:
				send "&cYou don't have enough money!!" to player

#ITEM SELL PRICES
options:
	p: &8&8SELL » #Prefix
	iron: 30 #1 iron ingot sell price
	coalgen: 100 #1 coal gen sell price
	coal: 15 #1 coal gen sell price
	spongeR: 15
	UspongeR: 25
	spongeGen: 100
	UspongeGen: 1000

on inventory click:
	if event-item is gray stained glass pane named " ":
		cancel event
	if event-item is diamond block named "&bClick to sell items":
		cancel event

command /shop:
	trigger:
		open chest with 3 rows named "&4&lShop" to player
		format gui slot 0 of player with gray stained glass pane named " "
		format gui slot 1 of player with gray stained glass pane named " "
		format gui slot 2 of player with gray stained glass pane named " "
		format gui slot 3 of player with gray stained glass pane named " "
		format gui slot 4 of player with gray stained glass pane named " "
		format gui slot 5 of player with gray stained glass pane named " "
		format gui slot 6 of player with gray stained glass pane named " "
		format gui slot 7 of player with gray stained glass pane named " "
		format gui slot 8 of player with gray stained glass pane named " "
		format gui slot 9 of player with gray stained glass pane named " "
		format gui slot 17 of player with gray stained glass pane named " "
		format gui slot 18 of player with gray stained glass pane named " "
		format gui slot 19 of player with gray stained glass pane named " "
		format gui slot 20 of player with gray stained glass pane named " "
		format gui slot 21 of player with gray stained glass pane named " "
		format gui slot 22 of player with gray stained glass pane named " "
		format gui slot 23 of player with gray stained glass pane named " "
		format gui slot 24 of player with gray stained glass pane named " "
		format gui slot 25 of player with gray stained glass pane named " "
		format gui slot 26 of player with gray stained glass pane named " "
		Format slot 13 of player with spawner named "&9&lGens" with lore "&3The shop where you buy gens (duh)" to run [ execute player command "/genshop"]
		Format slot 14 of player with netherite pickaxe named "&b&lTools" with lore "&9The shop where you buy tools (duh)" to run [ execute player command "/toolshop"]

command /toolshop:
	trigger:
		open chest with 3 rows named "&b&lTool Shop" to player
		format gui slot 0 of player with stone pickaxe named "&7&lStone Pickaxe" with lore "&6Buy: &e5000"
		format gui slot 1 of player with stone axe named "&7&lStone Axe" with lore "&6Buy: &e5000"
		format gui slot 2 of player with stone shovel named "&7&lStone Shovel" with lore "&6Buy: &e5000"
		format gui slot 3 of player with stone hoe named "&7&lStone Hoe" with lore "&6Buy: &e5000"
		format gui slot 4 of player with iron pickaxe named "&f&lIron Pickaxe" with lore "&6Buy: &e10000"
		format gui slot 5 of player with iron axe named "&f&lIron Axe" with lore "&6Buy: &e10000"
		format gui slot 6 of player with iron shovel named "&f&lIron Shovel" with lore "&6Buy: &e10000"
		format gui slot 7 of player with iron hoe named "&f&lIron Hoe" with lore "&6Buy: &e10000"

command /genshop:
	trigger:
		open chest with 3 rows named "&9&lGen Shop" to player
		format gui slot 0 of player with coal block named "&8&lCoal Gen" with lore "&eBuy:&6 1000 &6Sell: &e100"
		format gui slot 1 of player with sponge named "&e&lSponge Gen" with lore "&eBuy:&6 1000 &6Sell: &e100"

on inventory click:
	if event-item is coal block named "&8&lCoal Gen" with lore "&eBuy:&6 1000 &6Sell: &e100":
		if player's balance > 999:
			remove 1000 from player's balance
			give player coal block named "&8&lCoal Gen"
		if player's balance < 999:
			send "&6You do not have enough money to buy this!!" to player
			cancel event
on inventory click:
	if event-item is sponge named "&e&lSponge Gen" with lore "&eBuy:&6 1000 &6Sell: &e100":
		if player's balance > 999:
			remove 1000 from player's balance
			give player sponge named "&e&lSponge Gen"
		if player's balance < 999:
			send "&6You do not have enough money to buy this!!" to player
			cancel event
	if event-item is stone pickaxe named "&7&lStone Pickaxe" with lore "&6Buy: &e5000":
		if player's balance > 4999:
			remove 5000 from player's balance
			give player stone pickaxe named "&7&lStone Pickaxe"
		if player's balance < 4999:
			send "&6You do not have enough money to buy this!!" to player
			cancel event
	if event-item is stone axe named "&7&lStone Axe" with lore "&6Buy: &e5000":
		if player's balance > 4999:
			remove 5000 from player's balance
			give player stone axe named "&7&lStone Axe"
		if player's balance < 4999:
			send "&6You do not have enough money to buy this!!" to player
			cancel event
	if event-item is stone shovel named "&7&lStone Shovel" with lore "&6Buy: &e5000":
		if player's balance > 4999:
			remove 5000 from player's balance
			give player stone shovel named "&7&lStone Shovel"
		if player's balance < 4999:
			send "&6You do not have enough money to buy this!!" to player
			cancel event
	if event-item is stone hoe named "&7&lStone Hoe" with lore "&6Buy: &e5000":
		if player's balance > 4999:
			remove 5000 from player's balance
			give player stone hoe named "&7&lStone Hoe"
		if player's balance < 4999:
			send "&6You do not have enough money to buy this!!" to player
			cancel event
	if event-item is iron pickaxe named "&f&lIron Pickaxe" with lore "&6Buy: &e10000":
		if player's balance > 9999:
			remove 10000 from player's balance
			give player iron pickaxe named "&f&lIron Pickaxe"
		if player's balance < 9999:
			send "&6You do not have enough money to buy this!!" to player
			cancel event
	if event-item is iron axe named "&f&lIron Axe" with lore "&6Buy: &e10000":
		if player's balance > 9999:
			remove 10000 from player's balance
			give player iron axe named "&f&lIron Axe"
		if player's balance < 9999:
			send "&6You do not have enough money to buy this!!" to player
			cancel event
	if event-item is iron shovel named "&f&lIron Shovel" with lore "&6Buy: &e10000":
		if player's balance > 9999:
			remove 10000 from player's balance
			give player iron shovel named "&f&lIron Shovel"
		if player's balance < 9999:
			send "&6You do not have enough money to buy this!!" to player
			cancel event
	if event-item is iron hoe named "&f&lIron Hoe" with lore "&6Buy: &e10000":
		if player's balance > 9999:
			remove 10000 from player's balance
			give player iron hoe named "&f&lIron Hoe"
		if player's balance < 9999:
			send "&6You do not have enough money to buy this!!" to player
			cancel event

#SELL COMMANDS
command /sell:
	trigger:
		open chest with 3 rows named "&8Place items in here to sell!!" to player
		format gui slot 0 of player with gray stained glass pane named " "
		format gui slot 1 of player with gray stained glass pane named " "
		format gui slot 2 of player with gray stained glass pane named " "
		format gui slot 3 of player with gray stained glass pane named " "
		format gui slot 4 of player with diamond block named "&bClick to sell items"
		format gui slot 5 of player with gray stained glass pane named " "
		format gui slot 6 of player with gray stained glass pane named " "
		format gui slot 7 of player with gray stained glass pane named " "
		format gui slot 8 of player with gray stained glass pane named " "
		format gui slot 18 of player with gray stained glass pane named " "
		format gui slot 19 of player with gray stained glass pane named " "
		format gui slot 20 of player with gray stained glass pane named " "
		format gui slot 21 of player with gray stained glass pane named " "
		format gui slot 22 of player with gray stained glass pane named " "
		format gui slot 23 of player with gray stained glass pane named " "
		format gui slot 24 of player with gray stained glass pane named " "
		format gui slot 25 of player with gray stained glass pane named " "
		format gui slot 26 of player with gray stained glass pane named " "

on inventory click:
	if inventory name of current inventory of player contains "&8Place items in here to sell!!":
		if slot 9 or 10 or 11 or 12 or 13 or 14 or 15 or 16 of current inventory of player is coal block named "&8&lCoal Gen":
			set {_itemcounti} to number of all coal blocks named "&8&lCoal Gen" in event-inventory
			remove {_itemcounti} of coal blocks named "&8&lCoal Gen" from event-inventory
			add {@coalgen} * {_itemcounti} to the player's balance
			send "&6You sold %{_itemcounti}% &8Coal Gens. &e%{@coalgen} * {_itemcounti}% &6was added to your wallet"
		if slot 9 or 10 or 11 or 12 or 13 or 14 or 15 or 16 of current inventory of player is coal named "&8&lCoal":
			set {_itemcounti} to number of all coal named "&8&lCoal" in event-inventory
			remove {_itemcounti} of coal named "&8&lCoal" from event-inventory
			add {@coal} * {_itemcounti} to the player's balance
			send "&6You sold %{_itemcounti}% &8Coal. &e%{@coal} * {_itemcounti}% &6was added to your wallet"
		if slot 9 or 10 or 11 or 12 or 13 or 14 or 15 or 16 of current inventory of player is yellow dye named "&e&lSponge Remnant":
			set {_itemcounti} to number of all yellow dye named "&e&lSponge Remnant" in event-inventory
			remove {_itemcounti} of yellow dye named "&e&lSponge Remnant" from event-inventory
			add {@spongeR} * {_itemcounti} to the player's balance
			send "&6You sold %{_itemcounti}% &eSponge Remnants. &e%{@spongeR} * {_itemcounti}% &6was added to your wallet"
		if slot 9 or 10 or 11 or 12 or 13 or 14 or 15 or 16 of current inventory of player is glowing yellow dye named "&e&lUpgraded Sponge Remnant":
			set {_itemcounti} to number of all glowing yellow dye named "&e&lUpgraded Sponge Remnant" in event-inventory
			remove {_itemcounti} of glowing yellow dye named "&e&lUpgraded Sponge Remnant" from event-inventory
			add {@UspongeR} * {_itemcounti} to the player's balance
			send "&6You sold %{_itemcounti}% &eUpgraded Sponge Remnants. &e%{@UspongeR} * {_itemcounti}% &6was added to your wallet"

 

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