Jump to content

Bounty System | Kill System Too!


Recommended Posts

Bounty System

Using this script, you are

able to put "bounties" on players.

Once they die, the player who

killed them gets the bounty

that you placed on them.

I've also included a death system here.

Bounties can't be complete when

there's no death system. 😉 

I've also included bounty list. Once page 1

is full, Page 2 will be created and the

bounties will be continued in there.

 

Commands

/bounty <player> <amount> - The minimum amount is 500.

/bounties - Check the players with bounty.

Pictures

image.png.e643592f23e47d8f84d05ec9cb56b9db.png

image.png.bccb9a2ebae50e824fd20315aa270f3e.png

image.png.429f8b44b279dcb16301b445a682a767.png

 

Script (74 Lines Without the #)
 

options:
    min: 500    # Minimum bounty amount
    pre: &3&l(BOUNTY)  # Prefix for messages

command /bounty [<offline player>] [<number>]:
    trigger:
        if arg-1 is set:
            if arg-2 is set:
                if arg-2 >= {@min}:
                    if {balance::%uuid of player%} >= arg-2:    # I use {balance::%uuid of player%} as money. feel free to change it to "player's balance"
#                        arg-1 is not player (If you don't want players to put the bounty on themselves, remove the # at the start of the line.)
                        add argument 1 to {bounty::list::*} if {bounty::list::*} does not contain arg-1
                        add argument 2 to {bounty::%uuid of arg-1%}
                        remove argument 2 from {balance::%uuid of player%}
                        send "{@pre} &7A bounty of &b%arg-2%$ &7has been placed on &b%arg-1% by &b%player%" to all players
                    else:
                        send "{@pre} &7You do not have enough money to place a bounty."
                else:
                    send "{@pre} &7The minimum bounty amount is &b{@min}&7."
            else:
                send "{@pre} &7Please provide an amount."
        else:
            send "{@pre} &7Please provide a player."

on death of player:
    if attacker is a player: 
        if {bounty::list::*} contains victim:
            set {_bounty} to ("%{bounty::%uuid of victim%}%" parsed as number)
            add {_bounty} to {balance::%uuid of attacker%}
            broadcast "{@pre} &b%attacker% &7just claimed &b%victim%&7's bounty of &b%{_bounty}%$&7..."
            remove victim from {bounty::list::*}
            delete {bounty::%uuid of victim%}
        
        # Kill System
        add 1 to {kills::%uuid of attacker%}    # Assuming {kills::%uuid of attacker%} is your kills variable... (Change if you want..)
        add 1 to {deaths::%uuid of victim%}     # Assuming {deaths::%uuid of victim%} is your deaths variable... (Change if you want..)

        # KDR System (Remove if you want..)
        set {KDR::%uuid of attacker%} to KDR(attacker) # Assuming {KDR::%uuid of attacker%} is your variable for KDR (Change if you want.)
        set {KDR::%uuid of victim%} to KDR(victim)


# This KDR Function is not mine. This is BennyDoesStuff's KDR Function.

function KDR(p: player) :: number:
    set {_u} to uuid of {_p}
    if {kills::%{_u}%} != 0:
        if {deaths::%{_u}%} != 0:
            return {kills::%{_u}%} / {deaths::%{_u}%}
        else:
            return {kills::%{_u}%}
    else:
        return 0


# Bounties (See the players with bounties!)

command /bounties [<text>]:
    trigger:
        page(player, 0)

function page(p: player, page: number):
    set {_pageStart} to 45*{_page}
    set {_i} to 1
    set {_a} to 0
    open virtual chest inventory with size 6 named "&b&lBOUNTY &7List &f&oPage %{_page} + 1%" to {_p}
    wait 2 ticks
    loop {bounty::list::*}:
        (loop-index parsed as integer) > {_pageStart}
        set {_player} to loop-value
        set {_u} to uuid of {_player}
        format gui slot {_a} of {_p} with skull of ("%{_player}%" parsed as offline player) named "&7%{_player}%" with lore "&7Bounty &8- &b%{bounty::%{_u}%}%" to do nothing
        add 1 to {_a}
        if {_a} = ((45*{_i})):
            exit loop
    format gui slot 49 of {_p} with book named "&eMain Page" to run:
        page({_p}, 0)
    if (amount of {tuber::videos::%{_u}%::*}) > {_pageStart} + 45:
        
        format gui slot 53 of {_p} with arrow named "&9Next Page" to run:
            set {_page} to {_page} + 1
            page({_p}, {_page})
    if {_page} > 0:
        format gui slot 45 of {_p} with arrow named "&9Previous Page" to run:
            set {_page} to {_page} - 1
            page({_p}, {_page})

 

Edited by Swayl
  • Like 3
  • Been "Skripting" for half a year now
  • Whale type 
  • Doesn't like Idle Servers (But made one)
  • Doesn't like Mining-PvP servers (But made one)
  • Likes MrScopes lol

 

I make original memes about minehut too.

Capture.png.5a3e6c2c283f3e0ee17860d8704f25f6.png

 

  • Discord Swayl#4299
  • MC IGN - Swayl
Link to post
Share on other sites
  • 4 months later...
On 10/25/2019 at 8:09 PM, Hornzy said:

Probably a dumb qeustion but does this use a custome Currency or can you use essentials??

Sorry for late response but... Yes you can! You can just change {balance::%uuid of player%} to player's balance etc.

  • Been "Skripting" for half a year now
  • Whale type 
  • Doesn't like Idle Servers (But made one)
  • Doesn't like Mining-PvP servers (But made one)
  • Likes MrScopes lol

 

I make original memes about minehut too.

Capture.png.5a3e6c2c283f3e0ee17860d8704f25f6.png

 

  • Discord Swayl#4299
  • MC IGN - Swayl
Link to post
Share on other sites
  • 10 months later...
Guest
This topic is now closed to further replies.


×
×
  • Create New...