It reloads with no errors but the player head wont show up

  • 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!

Poinapples

Member
Feb 4, 2024
17
0
1
13
code_language.skript:
command /revivebook:
    permission: op
    trigger:
        give a book named "&b&lRevive Book" to player
        

on death of player:
    remove 1 from {lives.%victim%}
    message "&c-1" to victim
    give a nether star of unbreaking 1 named "&b&lLife Energy" to attacker
    if {lives.%victim%} is 0:
        execute console command "/ban %victim% &cYou have lost all of your lives!"
        broadcast "&c&l%victim% has lost all of thier lives and been deathbanned!"
        add uuid of victim to {bannedplayers::*}
        set {_uuid} to uuid of victim

command /fallen:
    trigger:
        message "%{bannedplayers::*}%" parsed as offline player to player


on right click:
    if event-item is book:
        if name of event-item is "&b&lRevive Book":
            set {Revive::Gui} to a new chest inventory with 6 row with name "&6&lRevive a player"
            set {_s} to 0
            loop {bannedplayers::*}:
                set {_T} to {_uuid} parsed as offline player
                set slot {_s} of {Revive::Gui} to {_uuid}'s skull named "&e%{_T}%"
                add 1 to {_s}
            open {Revive::Gui} to player
            set {reviveselected.%{_uuid}%} to false
            while {reviveselected.%{_uuid}%} is false:
                wait 1 tick





on inventory close:
    if event-inventory's name is "&6&lRevive a player":
        set {Reviving::%uuid of player%} to false



on inventory click:
    if event-inventory's name is "&6&lRevive a player":
        cancel event
        if event-item is player head:
            set {_uuid} to uuid of player
            set {reviving::%{_uuid}%} to true
            set {reviveselected.%{_uuid}%} to true
            close player's inventory
            set {_T} to "%event-item's name%"
            replace all "&e" with "" in {_T}
            replace all "§e" with "" in {_T}
            set {_Tplayer} to "%{_T}%" parsed as offline player
            set {_uuid} to uuid of {_Tplayer}
            remove {_uuid} from {bannedplayers::*}
            
            wait 12 seconds

            set {revived.%uuid of {_T}%} to true

            set {Reviving::%uuid of player%} to false
            set {lives.%{_uuid}%} to 3
            unban {_T}
            broadcast "&a%{_T}% &fwas ressurected"
        
on right click:
    if event-item is nether star:
        if name of event-item is "&b&lLife Energy":
            if {lives.%player%} < 12:
                add 1 to {lives.%player%}
                message "&c+1" to player
                remove 1 of event-item from player
            else:
                message "&4&lYou have reached the maximum amount of lives" to player
command /lives:
    trigger:
        message "&bYou have %{lives.%player%}% lives left" to player
command /givelives:
    permission: op
    trigger:
        give a nether star of unbreaking 1 named "&b&lLife Energy" to player
 
code_language.skript:
command /revivebook:
    permission: op
    trigger:
        give a book named "&b&lRevive Book" to player
       

on death of player:
    remove 1 from {lives.%victim%}
    message "&c-1" to victim
    give a nether star of unbreaking 1 named "&b&lLife Energy" to attacker
    if {lives.%victim%} is 0:
        execute console command "/ban %victim% &cYou have lost all of your lives!"
        broadcast "&c&l%victim% has lost all of thier lives and been deathbanned!"
        add uuid of victim to {bannedplayers::*}
        set {_uuid} to uuid of victim

command /fallen:
    trigger:
        message "%{bannedplayers::*}%" parsed as offline player to player


on right click:
    if event-item is book:
        if name of event-item is "&b&lRevive Book":
            set {Revive::Gui} to a new chest inventory with 6 row with name "&6&lRevive a player"
            set {_s} to 0
            loop {bannedplayers::*}:
                set {_T} to {_uuid} parsed as offline player
                set slot {_s} of {Revive::Gui} to {_uuid}'s skull named "&e%{_T}%"
                add 1 to {_s}
            open {Revive::Gui} to player
            set {reviveselected.%{_uuid}%} to false
            while {reviveselected.%{_uuid}%} is false:
                wait 1 tick





on inventory close:
    if event-inventory's name is "&6&lRevive a player":
        set {Reviving::%uuid of player%} to false



on inventory click:
    if event-inventory's name is "&6&lRevive a player":
        cancel event
        if event-item is player head:
            set {_uuid} to uuid of player
            set {reviving::%{_uuid}%} to true
            set {reviveselected.%{_uuid}%} to true
            close player's inventory
            set {_T} to "%event-item's name%"
            replace all "&e" with "" in {_T}
            replace all "§e" with "" in {_T}
            set {_Tplayer} to "%{_T}%" parsed as offline player
            set {_uuid} to uuid of {_Tplayer}
            remove {_uuid} from {bannedplayers::*}
           
            wait 12 seconds

            set {revived.%uuid of {_T}%} to true

            set {Reviving::%uuid of player%} to false
            set {lives.%{_uuid}%} to 3
            unban {_T}
            broadcast "&a%{_T}% &fwas ressurected"
       
on right click:
    if event-item is nether star:
        if name of event-item is "&b&lLife Energy":
            if {lives.%player%} < 12:
                add 1 to {lives.%player%}
                message "&c+1" to player
                remove 1 of event-item from player
            else:
                message "&4&lYou have reached the maximum amount of lives" to player
command /lives:
    trigger:
        message "&bYou have %{lives.%player%}% lives left" to player
command /givelives:
    permission: op
    trigger:
        give a nether star of unbreaking 1 named "&b&lLife Energy" to player
adding a "_" to the start of variables will make that variable only be set in that trigger so when you set it the second the trigger ends (immediately after) it gets unregistered
 
adding a "_" to the start of variables will make that variable only be set in that trigger so when you set it the second the trigger ends (immediately after) it gets unregistered
ok thanks but how would i have to change the variable to make it work? like change the type of variable
 
just remove the "_" at the beginning of the variable. so instead of {_uuid} it will be {uuid}