Friend or Foe

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

WAshedCar

New Member
May 15, 2024
5
0
1
25
can someone make a friend or foe skript for me? basically on join ug et 10 lives and an actionbar would show ur lives and when u die u loose a life on 0 ur banned and pvp turns on randomly every 20 minutes, and it makes a title which says "Pvp is on" or "pvp is off" when its off and a player tracker which opens a gui with the heads of everyone online and then u can click on it and hunt them and it gets removed after an hour
 
I could make the lives and pvp stuff but I don't have time for the bounty
AppleScript:
function join(p: player):
    set {_l} to 10
    if byte tag "LIVES" of nbt compound of {_p} is set:
        set {_l} to byte tag "LIVES" of nbt compound of {_p}
    set metadata tag "lives" of {_p} to {_l}
    delete byte tag "LIVES" of nbt compound of {_p}

function leave(p: player):
    if metadata tag "lives" of {_p} is set:
        set byte tag "LIVES" of nbt compound of {_p} to metadata tag "lives" of {_p}

on join:
    join(player)
    while player is online:
        send action bar "&4ʟᴇᴠᴇʟꜱ ʀᴇᴍᴀɪɴɪɴɢ: &f&l%metadata tag "lives" of player%" to player
        wait 40 ticks
on load:
    disable PvP in all worlds
    loop all players:
        join(loop-player)
    while script is loaded:
        if {pvp} is true:
            clear {pvp}
            enable PvP in all worlds
            send title "&a&lPVP IS ENABLED" to all players
        else:
            set {pvp} to true
            disable PvP in all worlds
            send title "&4&lPVP IS DISABLED" to all players
        wait 20 minutes
on leave:
    leave(player)
on unload:
    disable PvP in all worlds
    clear {pvp}
    loop all players:
        leave(loop-player)

on death of a player:
    if metadata tag "lives" of victim is set:
        set metadata tag "lives" of victim to (1 - metadata tag "lives" of victim)
        send action bar "&4ʟᴇᴠᴇʟꜱ ʀᴇᴍᴀɪɴɪɴɢ: &b&l%metadata tag "victim" of player%" to victim
 
I could make the lives and pvp stuff but I don't have time for the bounty
AppleScript:
function join(p: player):
    set {_l} to 10
    if byte tag "LIVES" of nbt compound of {_p} is set:
        set {_l} to byte tag "LIVES" of nbt compound of {_p}
    set metadata tag "lives" of {_p} to {_l}
    delete byte tag "LIVES" of nbt compound of {_p}

function leave(p: player):
    if metadata tag "lives" of {_p} is set:
        set byte tag "LIVES" of nbt compound of {_p} to metadata tag "lives" of {_p}

on join:
    join(player)
    while player is online:
        send action bar "&4ʟᴇᴠᴇʟꜱ ʀᴇᴍᴀɪɴɪɴɢ: &f&l%metadata tag "lives" of player%" to player
        wait 40 ticks
on load:
    disable PvP in all worlds
    loop all players:
        join(loop-player)
    while script is loaded:
        if {pvp} is true:
            clear {pvp}
            enable PvP in all worlds
            send title "&a&lPVP IS ENABLED" to all players
        else:
            set {pvp} to true
            disable PvP in all worlds
            send title "&4&lPVP IS DISABLED" to all players
        wait 20 minutes
on leave:
    leave(player)
on unload:
    disable PvP in all worlds
    clear {pvp}
    loop all players:
        leave(loop-player)

on death of a player:
    if metadata tag "lives" of victim is set:
        set metadata tag "lives" of victim to (1 - metadata tag "lives" of victim)
        send action bar "&4ʟᴇᴠᴇʟꜱ ʀᴇᴍᴀɪɴɪɴɢ: &b&l%metadata tag "victim" of player%" to victim
levels? its supposed to be lifes lol but is it possible for a permeneant actionbar when pvp is on to have the countdown until its ioff
 
Yes you can do that, although I believe Gryphon formatted his action bars wrong.
Post automatically merged:

Yes you can do that, although I believe Gryphon formatted his action bars wrong.