/rob steals up to 10% of a member’s coins with a one-in-three chance and a five-minute cooldown, unless the victim bought a padlock with /padlock, which breaks on the first attempt and protects them
A robbery system for the MEE6 economy where members can steal coins from each other — or defend against it.
Commands:
/rob @member — Try to steal up to 10% of their coins (1-in-3 success chance, 5-minute cooldown)/padlock — Buy protection for 200 coins that blocks the next robbery attemptThe padlock breaks when someone tries to rob you, protecting your coins but consuming the padlock. Failed robberies trigger the cooldown, so choose your targets wisely!
Made by MEE6. Remix it to get a copy of your own and change anything you like.
❌ Failed! Alex caught you in the act.
⏰ You can rob again in 300s.
❌ Failed! Alex caught you in the act.
❌ Failed! Alex caught you in the act.
🔒 You bought a padlock for 200 coins! It will protect you from the next robbery attempt.
🔒 Alex had a padlock! It broke, but you got nothing.
💰 Success! You stole 13 coins from Alex!
// Robbery system with padlock protection
// /rob: steal coins from another member (1/3 chance, 5min cooldown)
// /padlock: buy protection that breaks on first robbery attempt
const COOLDOWN = 300; // 5 minutes
const SUCCESS_CHANCE = 1 / 3;
const MAX_STEAL_PERCENT = 0.1; // 10%
const PADLOCK_COST = 200;
mee6.command(
'rob',
{
description: 'Try to rob another member (1/3 chance, 5min cooldown)',
options: [{ name: 'target', type: 'user', description: 'Who to rob', required: true }],
},
async (ctx) => {
const targetId = ctx.option<string>('target');
// Can't rob yourself
if (targetId === ctx.author.id) {
await ctx.reply('You cannot rob yourself!');
return;
}
// Can't rob a bot
const target = await mee6.getMember(targetId);
if (!target) {
await ctx.reply('That member was not found.');
return;
}
if (target.bot) {
await ctx.reply('You cannot rob bots!');
return;
}
// Check cooldown
const m = mee6.store.member(ctx.author.id);
const lastRob = await m.get<number>('last_rob', 0);
const now = Math.floor(Date.now() / 1000);
if (now - lastRob < COOLDOWN) {
const remaining = COOLDOWN - (now - lastRob);
await ctx.reply(`⏰ You can rob again in ${remaining}s.`);
return;
}
// Check if target has a padlock
const targetStore = mee6.store.member(targetId);
const hasPadlock = await targetStore.get<boolean>('has_padlock', false);
if (hasPadlock) {
// Break the padlock
await targetStore.delete('has_padlock');
await m.set('last_rob', now);
await ctx.reply(`🔒 ${target.displayName} had a padlock! It broke, but you got nothing.`);
return;
}
// Get target's balance
const targetBalance = await mee6.economy.balance(targetId);
if (targetBalance.coins < 10) {
await ctx.reply(`${target.displayName} has less than 10 coins — not worth robbing!`);
return;
}
// Roll for success
const success = Math.random() < SUCCESS_CHANCE;
await m.set('last_rob', now);
if (success) {
// Steal up to 10% of their coins
const maxSteal = Math.floor(targetBalance.coins * MAX_STEAL_PERCENT);
const stolen = Math.max(1, Math.floor(Math.random() * maxSteal) + 1);
await mee6.economy.remove(targetId, stolen);
await mee6.economy.add(ctx.author.id, stolen);
await ctx.reply(`💰 Success! You stole **${stolen}** coins from ${target.displayName}!`);
} else {
await ctx.reply(`❌ Failed! ${target.displayName} caught you in the act.`);
}
}
);
mee6.command(
'padlock',
{
description: `Buy a padlock for ${PADLOCK_COST} coins (blocks one robbery attempt)`,
},
async (ctx) => {
const m = mee6.store.member(ctx.author.id);
// Check if they already have one
const hasPadlock = await m.get<boolean>('has_padlock', false);
if (hasPadlock) {
await ctx.reply('🔒 You already have a padlock!');
return;
}
// Check balance
const balance = await mee6.economy.balance(ctx.author.id);
if (balance.coins < PADLOCK_COST) {
await ctx.reply(`You need **${PADLOCK_COST}** coins to buy a padlock. You have **${balance.coins}**.`);
return;
}
// Purchase padlock
await mee6.economy.remove(ctx.author.id, PADLOCK_COST);
await m.set('has_padlock', true);
await ctx.reply(
`🔒 You bought a padlock for **${PADLOCK_COST}** coins! It will protect you from the next robbery attempt.`
);
}
);