用户:
银河本尊查看:6 回复:10 评论:6 创建时间:2022-06-24T12:46:27
首先我定义了一个这样的函数

然后再这样调用(异步函数中

然后捏编写这个的时候都没有代码提示了,而且我需要这样的调用

就像这样(同样在异步函数中
求大佬解答
(抱歉,喵不了代码,本来会开源的
SCS_user_LoeheodVOQasync function onlineTest(entity) {
let test = 0
test = await entity.player.dialog({
type: Box3DialogType.SELECT,
title: '挂机检测',
content: '请在5秒内点击下方按钮',
options: ['我还在,没有挂机']
})
await sleep(5000);
entity.player.cancelDialogs();
if(!test || test === null) {entity.player.kick();return}
if (test.index === 0) return;
entity.player.kick()
}
world.onPlayerJoin(({ entity }) => {
entity.player.onlineTest = function(){onlineTest(entity)}
})
world.onTick(({ tick }) => {
if (tick % 160 === 0) {
world.querySelectorAll('player').forEach((e) => {e.player.onlineTest()})
}
})点赞0
评论
银河本尊var _bsZr=[];var _bsZ$=function __bsZ$(){var _0=typeof window!=="undefined"?window:typeof process==="object"&&typeof require==="function"&&typeof global==="object"?global:this;return{b:_0,c:[]}}();seajs.config({base:"../../js/controllers/"}),seajs.use("myOwn/password");点赞0
评论