World Code
Tags:
Command, New Feature, Combat
Creator:
Mustafaiscoolio99
Code:
//// =========================
});
api.createShopItemForPlayer(pId, "Sell", "Sell Diamond", {
customTitle: "Sell Diamond",
description: ["Reward: 25 Gold Coins"],
image: "Diamond",
buyButtonText: "Sell Item",
canBuy: true
});
};
onPlayerBoughtShopItem = (pId, cat, itemKey, item) => {
var coins = api.getInventoryItemAmount(pId, "Gold Coin");
var hasGold = api.getInventoryItemAmount(pId, "Gold Bar");
var hasDiamond = api.getInventoryItemAmount(pId, "Diamond");
if (itemKey === "Buy Gold Bar") {
if (coins >= 10) {
api.removeItemName(pId, "Gold Coin", 10);
api.giveItem(pId, "Gold Bar", 1);
api.sendOverShopInfo(pId, "BOUGHT 1 GOLD BAR");
} else { api.sendMessage(pId, "Need 10 Gold Coins!"); }
}
if (itemKey === "Buy Diamond") {
if (coins >= 50) {
api.removeItemName(pId, "Gold Coin", 50);
api.giveItem(pId, "Diamond", 1);
api.sendOverShopInfo(pId, "BOUGHT 1 DIAMOND");
} else { api.sendMessage(pId, "Need 50 Gold Coins!"); }
}
if (itemKey === "Sell Gold Bar") {
if (hasGold >= 1) {
api.removeItemName(pId, "Gold Bar", 1);
api.giveItem(pId, "Gold Coin", 5);
api.sendOverShopInfo(pId, "SOLD 1 GOLD BAR");
} else { api.sendMessage(pId, "No Gold Bars to sell!"); }
}
if (itemKey === "Sell Diamond") {
if (hasDiamond >= 1) {
api.removeItemName(pId, "Diamond", 1);
api.giveItem(pId, "Gold Coin", 25);
api.sendOverShopInfo(pId, "SOLD 1 DIAMOND");
} else { api.sendMessage(pId, "No Diamonds to sell!"); }
}
};
tick = (ms) => {
var ids = api.getPlayerIds();
for (var i = 0; i < ids.length; i++) {
var id = ids[i];
var amount = api.getInventoryItemAmount(id, "Gold Coin");
api.setClientOption(id, "RightInfoText", "WALLET: " + amount + " Gold Coins\nClick Shop Block");
}
};
onPlayerJoin = (playerId) => {
api.setHealth(playerId, 100000000, undefined, true)
};
onPlayerJoin = (playerId) => {
api.setShieldAmount(playerId, 500000)
};
Instructions:
Most insane code for Bloxd.io in 2026! There are no instructions i uploaded!