#(Resolved)
1 messages · Page 1 of 1 (latest)
umm... i am bit busy but i will give you my tpa system, it's kinda having errors
function tpaGUI(player) {
let tpaGUI = new ActionFormData()
let players = world.getAllPlayers()
tpaGUI.title("TPA MENU")
tpaGUI.body("Choose one to go")
for (let player of players) {
tpaGUI.button(player.name)
}
forceUi (tpaGUI,player).then(({selection : index}) => {
let target = players[index]
AcceptForm(target,player)
})
}```
function AcceptForm(player) {
let aui = new MessageFormData()
aui.title("Accept TPA")
aui.body(`${sender.name} has sent you tpa request. \nDo You Want To Accept It?`)
aui.button1("Decline")
aui.button2("Accept")
forceUi(aui,player).then(({selection : index}) => {
if (index == 0) {
sender.teleportFacing(player.location,player.dimension,player.location)
} else {
sender.tell(`${player.name} has declined your request`)
}
})
}```
I can’t fix them right now because I’m at school I fix for you wan I come back in like 2 or 3 hours
ok np
function forceUi ( form, player, timeout = 20 * 5 ) {
return new Promise( async (resolve, reject) => {
system.run(async function run() {
let response
try {
response = await form.show( player )
} catch (error) {
reject( error )
return
}
const {
canceled,
cancelationReason
} = response
if (canceled && cancelationReason == FormCancelationReason.userBusy) {
timeout-- && system.run( run )
return
}
resolve( response )
})
})
}```
that's it
I already have a tpa system I give you that
tq
Yea
And I already have all the system you I just need to give it to you wan I come back
I add you bug me in 2 or 3 hours about it so I don’t forget
ok
There is an error in this [code](#1148629180301443142 message):
[36m<repl>.js[0m:[33m18[0m:[33m70[0m - [31merror[0m[30m TS2551: [0mProperty 'userBusy' does not exist on type 'typeof FormCancelationReason'. Did you mean 'UserBusy'?
[7m18[0m if (canceled && cancelationReason == FormCancelationReason.userBusy) {
[7m [0m [31m ~~~~~~~~[0m
[36m@minecraft/server-ui.d.ts[0m:[33m59[0m:[33m13[0m
[7m59[0m UserBusy = 'UserBusy',
[7m [0m [36m ~~~~~~~~[0m
'UserBusy' is declared here.
@remote pelican
const playerList = [...world.getAllPlayers()].filter(plr => plr.name !== player.name);
const form = new ModalFormData();
form.title('Money transfer');
form.dropdown('Select a target...', ['None', ...playerList.map(plr => plr.name)]);
form.slider("Select a value...", 1, 1000, 2);
form.show(player).then(result => {
if (result.canceled) player.sendMessage('You closed the form!');
if (!result.formValues[0] && !result.formValues[1]) return;
const target = playerList[result.formValues[0] - 1];
const valInput = result.formValues[1];
const senderScore = world.scoreboard.getObjective('money').getScore(player.scoreboardIdentity)
if (valInput > senderScore) {
player.sendMessage(You have insufficient funds to transfer money: ${senderScore});
return;
}
const formattedValInput = Math.floor(valInput);
target.runCommandAsync(scoreboard players add ${target.name} Money ${formattedValInput})
player.runCommandAsync(scoreboard players remove ${player.name} Money ${formattedValInput})
target.sendMessage(Player ${player.name} has sent you §a$${formattedValInput}!);
player.sendMessage(You have sent §a$${formattedValInput}§f to ${target.name}!);
})
}
})
money transfer
change the objective if needed
i can help too if you want
ok:D
it says that runCommandAsync not defined
why cant you learn yourself
i am lazy tho
and i know how to script
if I am having errors then i will ask for help
so please with out knowing what is it don't comment
Then don’t be lazy
yeah that’s fine but you can’t just expect people to make you a skygen for free
Also if you know how to script you should know how to do all these features pretty easily
I fucking hate seeing this script being reused
wtf is this […world.getAllPlayers()] 💀💀💀
I don't ask to make for free
aight, whats issue here
where does it say paid

and thank you for asking me @gaunt pine
@remote pelican you dont change names
@ruby light bro 😂😂😂😂😂😂😭💔
what
what?
My wish