Jump to content

Need help with commands in GUI's


WildX

Recommended Posts

I need help with making it so when i click on an item it runs a command that isnt just "set weather clear" 

for example I want to be able to click on a spawner in the gui and it runs the command "/us givespawner _Wild_IQ cow"

hope someone can help

Link to comment
Share on other sites

Oh nevermind, this should work:

 

command /spawner:
    trigger:
        wait 1 tick
        open chest with 3 rows named "&5&lShop" to player
        set slot 13 of player with monster spawner named "Cow" to close then run "/us givespawner _Wild_IQ cow"

 

 

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

Link to comment
Share on other sites

command /spawner:
    trigger:
        wait 1 tick
        open chest inventory with 3 rows named "&5&lShop" to player
        set slot 13 of player's current inventory to spawner named "&9COW"

on inventory click:
	if name of player's current inventory contains "&5&lShop":
		cancel event
		if index of event-slot is 13:
			execute console command "us givespawner _Wild_IQ cow"
			send "&7Received &9COW &7spawner!"

Should work 🙂 Hope this helps        

This script can easily be changed to better suit an economy based server, for example the spawner could cost 1500 in-game money, and on inventory click it will check the balance of the player and remove the cost of the spawner from their balance.

Edited by AbusingNub
  • Like 1
  • Thanks 1

--- AbusingNub ---


-- Owner of the DevilsNetwork --

◉ DevilsPvP.minehut.gg

◉ BridgesWar.minehut.gg


Here to lend a helping hand.


 

Link to comment
Share on other sites

13 hours ago, AbusingNub said:
command /spawner:
    trigger:
        wait 1 tick
        open chest inventory with 3 rows named "&5&lShop" to player
        set slot 13 of player's current inventory to spawner named "&9COW"

on inventory click:
	if name of player's current inventory contains "&5&lShop":
		cancel event
		if index of event-slot is 13:
			execute console command "us givespawner _Wild_IQ cow"
			send "&7Received &9COW &7spawner!"

Should work 🙂 Hope this helps        

This script can easily be changed to better suit an economy based server, for example the spawner could cost 1500 in-game money, and on inventory click it will check the balance of the player and remove the cost of the spawner from their balance.

thank you this worked perfectly!

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

13 hours ago, AbusingNub said:
command /spawner:
    trigger:
        wait 1 tick
        open chest inventory with 3 rows named "&5&lShop" to player
        set slot 13 of player's current inventory to spawner named "&9COW"

on inventory click:
	if name of player's current inventory contains "&5&lShop":
		cancel event
		if index of event-slot is 13:
			execute console command "us givespawner _Wild_IQ cow"
			send "&7Received &9COW &7spawner!"

Should work 🙂 Hope this helps        

This script can easily be changed to better suit an economy based server, for example the spawner could cost 1500 in-game money, and on inventory click it will check the balance of the player and remove the cost of the spawner from their balance.

Thanks for the help!

  • Like 1

 

imgonline-com-ua-resize-CNNkL1drx5M-removebg-preview.png.d6a8ae8b5eb862005fb056c21f934200.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...