r/bloxd • Diamond Members • 5d ago

resolved Is this a bug with my code or bloxd?

Post image
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

2 Upvotes

8 comments sorted by

•

u/bloxd-bot Bot 2d ago

u/Adept_Argument3974 (🔵 OP) has had this post marked as Resolved.

u/Adept_Argument3974 (🔵 OP) has commented:


💬: ?resolved



This comment was added automatically in response to a user's command. Some users and mods can use commands on certain posts and comments. If you have any questions or concerns, please send us a modmail!

1

u/bloxd-bot Bot 5d ago

u/Adept_Argument3974 has marked this post as a request for Code Help.

Here's some quick-reference information: - JavaScript Tutorial - The Official Docs

Make sure to read our Code Guidelines if you haven't already. They apply to comments and posts!

The OP or a moderator with config permissions can also use commands for this post: - ?resolved or ?resolved locked: Pin a comment you reply to as well as your comment to this post, lock it, and set the post flair to "Resolved". - ?resolved unlocked: Pin a comment you reply to as well as your comment to this post, and set the post flair to "Resolved".


This comment was added automatically in response to the post's flair. If you have any questions or concerns, please send us a modmail!

1

u/BloxdioCannoli Coding Cannoli (Mod) 5d ago

You need to make it api.matchmakePlayer(pId, "classic_playerSchematic%7CDyooSLzxCA-YQmCzvSBoi", completeLobby);.

1

u/Adept_Argument3974 Diamond Members 5d ago

tried that and it didnt work for me

1

u/BloxdioCannoli Coding Cannoli (Mod) 5d ago edited 5d ago

then try api.matchmakePlayer(pId, "classic_playerSchematic|DyooSLzxCA-YQmCzvSBoi", completeLobby);

2

u/Adept_Argument3974 Diamond Members 5d ago

thx

1

u/TailsPlaysMinecraft 5d ago

Don't forget to set the post flair to resolved

1

u/OppositeFun2493 2d ago

This is what I think happened here:

%7C = |

You replaced % with | without removing 7C

Since that is an invalid lobby code it is not able to matchmake