Is this a bug with my code or bloxd?
▲ 2 r/bloxd

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

u/Adept_Argument3974 — 13 days ago
▲ 1 r/bloxd

global variables and functs help(wavend() isnt being defined)

src.global.d.ts code

export{} declare global{ var waveCountStart = 0; var waveCount = 1; var tickcount = 0; var idOfPlayer = api.getPlayerIds()[0]; var wavenum = 1; var highestClear=0; function customkeypage(displayname:string,type1:string,desc:string):void; function wavend():void; } globalThis.customkeypage=function customkeypage(displayname, type1, desc) { api.giveItem(api.getPlayerIds()[0], "Book", 1, { customDisplayName: displayname, customAttributes: { type: type1 }, customDescription: "Burn this to get the items associated with the " + desc }); } globalThis.wavend=function wavend() { if (wavenum == 1) { customkeypage("Rookie's Keypage", "Rookie", "rookie"); wavenum += 1; } else if (wavenum == 2) { wavenum += 1; customkeypage("Weal's Keypage", "Weal", "weal"); customkeypage("Woe's Keypage", "Woe", "woe");
} }

main world code:

/// <reference path="src./global.d.ts" />
export { };
function onPlayerJoin(myId) {

globalThis.waveCountStart = 0;
globalThis.waveCount = 1;
globalThis.tickcount = 0;
globalThis.idOfPlayer = api.getPlayerIds()[0];
globalThis.wavenum = 1;
api.setPosition(idOfPlayer, -46, 4, -57);
api.sendMessage(idOfPlayer, "Light Mother:Hello,Hello dear guest. I am the Light Mother, the director and host of the Lightspire Mechanism.", { color: "Yellow" });
api.sendMessage(idOfPlayer, "Light Mother: You'll be here for a very long while,might as well make yourself comfy.", { color: "Yellow" });
globalThis.customkeypage = function customkeypage(displayname, type1, desc) {
api.giveItem(api.getPlayerIds()[0], "Book", 1, {
customDisplayName: displayname,
customAttributes: { type: type1 },
customDescription: "Burn this to get the items associated with the " + desc
});
};

}

function onPlayerChat(idOfPlayer, command) {

let num = 0;
let commandSplit1 = command.substring(1);
num = Number(commandSplit1);

if (command == "?" + num && Number.isInteger(num)) {
wavenum = num;
api.sendMessage(idOfPlayer, "Next wave you start will be wave " + num, { color: "lime" });

return false;
}
if (command == "?help") {
api.sendMessage(idOfPlayer,
"?help:This shows you the help screen.\n" +
" \n" +
"?(num):Use this command to set the wave you wanna play(ex:I want to play wave 1,so I would type '?1'in chat).\n" +
" \n" +
"?wave#:This shows you the current wave,use ?(num) to change it", { color: "Lime" })
;}

if (api.getPlayerDbId(idOfPlayer) == "DTjSw8zgB28eny-myWgxN") {
if (command == "?wipe") {
api.clearInventory(idOfPlayer);
api.sendMessage(idOfPlayer, "succesfully wiped inv", { color: "lime" });
return false;
}
if (command == "?waveCount") {
console.log(waveCount)
return false;

}
if (command == "?reset") {
globalThis.waveCountStart = 0;
globalThis.waveCount = 1;
globalThis.tickcount = 0;
globalThis.idOfPlayer = api.getPlayerIds()[0];
globalThis.wavenum = 1;

api.sendMessage(idOfPlayer, "succesfully reset all variables", { color: "lime" });
return false;

}

}

if (command == "?wave#") {
api.sendMessage(idOfPlayer, "wave is " + wavenum, { color: "lime" });

}

}

function onMobKilledOtherMob() {
waveCount -= 1;

if (waveCount == waveCountStart) {
wavend();

}

}
function onMobKilledPlayer() {
waveCount = waveCountStart;
api.sendMessage(myId, "Wave " + " failed");

}
function onPlayerKilledMob(myId){
waveCount -= 1;

if (waveCount == waveCountStart) {
wavend();

}

}

reddit.com
u/Adept_Argument3974 — 2 months ago
▲ 1 r/bloxd

How do i remove custom items from the player's inventory,removeItemName "Book" would just remove a random book instead of the one being held,getheld gives you an array for some reason

u/Adept_Argument3974 — 2 months ago

How do I beat the game in 10 days

Im STOTC (0 receptions done,doing all realizations,doing netszack rn)

i can play for 6 and a half hours on a weekday and pretty much the whole day on weekends

reddit.com
u/Adept_Argument3974 — 3 months ago

(Spoiler for the entire game)Ai makes a deck for every library lvl(it tried its best)

ik im using fraud gemi but i dont have my chatgpt account rn

ai wasnt too far off for some of these,kinda suprised ngl

mods pls dont strike me down i swear this is for discussion has a lot of correlation with the game and isnt ai spam

u/Adept_Argument3974 — 3 months ago
▲ 2 r/bloxd

There should be a megathread or better yet another sub just to host code

Not only would it filter out this sub's massive amount of code help or requests but it would also make getting help for code easier as there is a dedicated place for it

u/Adept_Argument3974 — 5 months ago

looking for a backroons rpg game with difficult combat but satsifying combat

Make sure it's using the fandom or wikidot interpretation of the backrooms .I don't mind the combat system as long as it feels rewarding(ex:souls likes) and rewarding. It can't have turn based combat since I feel like that would make the backrooms(a chaotic place) into an orderly system.

u/Adept_Argument3974 — 5 months ago