#bounty sistem
1 messages ยท Page 1 of 1 (latest)
console.warn('main.js funza')
import { world, system } from "@minecraft/server"
world.afterEvents.entityDie.subscribe(data => {
let victim = data.deadEntity;
let killer = data.damageSource?.damagingEntity;
if (killer?.typeId !== "minecraft:player") {
return;
}
if (killer?.typeId == "minecraft:player" && victim?.typeId == "minecraft:player") {
const effects = ["strength", "regeneration"];
const effectRNG = effects[Math.floor(Math.random() * effects.length)];
killer.runCommandAsync(`effect @s ${effectRNG} 11 5`);
killer.runCommandAsync(`scoreboard players add @s money 1`);
killer.runCommandAsync(`scoreboard players add @s bounty 10`);
// Victim actions
victim.runCommandAsync(`scoreboard players remove @s money 10`);
victim.runCommandAsync(`scoreboard players set @s bounty 0`);
}
});
But i dont know how to give the money at the same amount as the bounty of the victim(at the killer)
it's possible to do it?
hm
Hm
one moment please
Yeah... I don't know how to use the scoreboard, But at least I changed some things.
console.warn('main.js funza')
import { world, system } from "@minecraft/server"
world.afterEvents.entityDie.subscribe(data => {
let victim = data.deadEntity;
let killer = data.damageSource?.damagingEntity;
if (killer?.typeId !== "minecraft:player" || victim?.typeId !== "minecraft:player") return;
const effects = ["strength", "regeneration"];
const effect = effects[Math.floor(Math.random() * effects.length)];
killer.addEffect(effect, 220, { amplifier: 5 });
killer.runCommandAsync(`scoreboard players add @s money 1`);
victim.runCommandAsync(`scoreboard players remove @s money 10`);
victim.runCommandAsync(`scoreboard players set @s bounty 0`);
});
I hope someone can help you
No
how to make every one ignore your post 
.
What did he say? ๐
nothing
just a random ping asking for help
my reply is kinda true but i should probably never said that
@tidal sand sorry about that
do you still need help?