
Is this a bug with my code or bloxd?
var pId = undefined;
var lobbyName = Number(api.getLobbyName());
var key = "aoseursuaeua0493@~~";
var dbId = null;
var isMatchmaking = false;
if (Number.isNaN(lobbyName)) lobbyName = 0;
function onPlayerJoin(myId) {
pId = myId;
dbId = api.getPlayerDbId(pId);
if (lobbyName >= 98123600000 && lobbyName <= 981236800000) {
api.setPosition(pId, 22, 11, -14);
if (api.getPlayerDbValue(pId, `key${dbId}`) != "true") //api.kickPlayer(pId,"Join via normal servers")
api.setPlayerDbValue(pId, `key${dbId}`, "false");
}
else {
api.setPosition(pId, 0, 11, -18);
}
}
function tick() {
if (pId == undefined || dbId == undefined) return;
let blockStanding = api.getBlockTypesPlayerStandingOn(pId)[0];
if (blockStanding === "Black Planks") {
if (!isMatchmaking) {
isMatchmaking = true;
api.setPlayerDbValue(pId, `key${dbId}`, "true");
let join1 = "98123";
let randomNumber = Math.floor(Math.random() * 100000);
let join2 = String(randomNumber).padStart(5, '0');
let completeLobby = `${join1}${join2}`;
api.matchmakePlayer(pId, "classic_playerSchematic|7CDyooSLzxCA-YQmCzvSBoi", completeLobby);
}
} else {
if (isMatchmaking) {
isMatchmaking = false;
}
}
}
This bug happens whenever touch the black wood and tp to random lobby in my custom game
it worked perfectly fine when tping to survival servers so I don't know why it ain't working here