Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use? #26

Open
frederik-giesske opened this issue Sep 22, 2019 · 1 comment
Open

How to use? #26

frederik-giesske opened this issue Sep 22, 2019 · 1 comment

Comments

@frederik-giesske
Copy link

Hello, I have some questions:

  1. in which file path do I have to save a new function?
  2. how can I trigger a function via command e.g. /warp and it opens a menu where I can select a warp
    Please give me a full example.
@xxAROX
Copy link

xxAROX commented Jul 2, 2020

//your command here
$player->sendForm(new MenuForm(
				"Selecte a Button",
				"",
				["Button 1","Button 2","Button 3"],
				function (Player $player, Button $button): void{// if the player press a button.
					$selected = $button->getText();
					$player->sendMessage("selected {$selected}");
				},
				function (Player $player): void{// if the player press "X".
					$player->sendMessage("Closed.");
				}
			));

I hope i can help you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants