#password protected gui
1 messages · Page 1 of 1 (latest)
ur code:
import { world } from "@minecraft/server";
import { ActionFormData, ModalFormData } from "@minecraft/server-ui";
world.events.entityHit.subscribe((eventData) => {
const player = eventData.source;
if (eventData.hitBlock) {
new ModalFormData()
.title("Verification")
.textField("Enter a password", "Password123")
.show(player).then((resultData) => {
const password = "password";
const input = resultData.formValues[0];
if (password == input) {
new ActionFormData()
.title("title")
.body("body")
.button("button")
.show(player);
}
else player.tell(`§4The password you entered is incorrect!`);
});
};
});

I haven't slept from yesterday
Not quite