#Help me with smth small

1 messages · Page 1 of 1 (latest)

timid tree
#

Im trying to do a !sell command and I alr have the gui and everything done I just cant seem to make it pop the gui upon message as the chat is like blocking the gui from ever being poped open.
How to other people manage to make it so the gui only pops when you also close the chat? I cant seem to make it work.

My script

else if (command === "!sell") {
player.sendMessage("§6Close the chat to view the sell menu!");

system.run(() => {
    showItemsToBeSold(player);
});

}

Please help me fix this if you can! Would make me able to fix other !commands for my lifesteal :)

gloomy axle
#

in the showItemsToBeSold, add the following in your .then condition:

form.show(player).then({selected, canceled, cancellationReason}=>{
  if (cancellationReason == "userBusy") return showItemsToBeSold(player)
})

This is because the form doesn't manually automatically do validation checks like "is the player in a menu?" So while we can't close the chat and make it open up directly from that, we can wait until the player closes said menu to show it to them.

icy raft
gloomy axle
timid tree
#

ohh youall to smart lol

#

let me just read all of this text so i can actually understand this

icy raft
timid tree
#

Quick question. isnt it cancellationReason === "userBusy"?

#

or does it need to have only 2 "=="

gloomy axle
#

you could use strict equality for it, shouldn't make a difference

timid tree
#

ey but Remanxnce? I got a question. I had a good scripter friend like a few months ago. and he helped me like setup VSC.

icy raft
timid tree
#

And now i did a factory reset a few days ago and I dont know what exctentions to use on VSC. Like he told me to install like This and that. The ones i got right now is this.

timid tree
echo flame
#

Umm how do I detect chat messages

errant rivet
#

but it's best to use === anyway

timid tree
#

world.beforeEvents.chatSend

echo flame
#

Ok

errant rivet
timid tree
#

This way you can like check if a player did a message

timid tree
#

Ill just use the standart === then

#

Yo R can you dm me?

echo flame
#

It’s literally not in documentation

timid tree
#

here @echo flame

https://jaylydev.github.io/scriptapi-docs/1.21.60/modules.html

Just click on the module you need. like for an example you would either use

@minecraft/server like 17.0 or 18.0 beta

and then you can just like go to world catagory and then in there youll see all kinds of stuff like before and after events and how to use and stuff

echo flame
#

Thanks

errant rivet
timid tree
errant rivet
timid tree
#

nevermind im just bothering you that way