Send Action Bar "" to Loop-Player not working.

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

Status
Not open for further replies.

VerySmashing

Member
Apr 14, 2021
1
0
1
21
Hello, I looked around in the forums to see if others were having the same problem as me, but theirs were fixed by my problem. :emoji_frowning:

I am working on a minecraft rpg server, which is for a specific fandom I like. I'm trying to create a battle skript, but this specific part that I'm having issues with is where I wish to have the action bar say the amount of kills each side has, as well as the time left. But it wont even appear on my action bar! I will send all of the loop for context. I am doing this in a loop that occurs every tick.

Code:
every 1 tick in "DSMAP":
    loop all players:
        if {battle} is true:
            set {battleTime} to difference between {battleTimeStart} and now
            set {battleTime} to floor({battleTime})
            set {battleTimeLeft} to difference between 10 minutes and {battleTime}
            set {battleTimeLeft} to floor({battleTimeLeft})
            if {clan::loop-player} is {yourClan}:
                send action bar "&7Time left: %{battleTimeLeft}%%nl%&8&l%{yourClan}%: &6%{yourClanKills}% &8&l%{otherClan}%: &6%{otherClanKills}%" to loop-player
                if {battleTimeLeft} is 0 seconds:
                    set {battle} to false
                    set {yourClanKills} to 0
                    set {otherClanKills} to 0
                    reset {battleTime}
                    reset {battleTimeLeft}
                    if {yourClanKills} > {otherClanKills}:
                        broadcast "&5&lStarlit &d&lForest&7&l>>&r &6&l%{yourClan}% has won the battle! &7&lGood job to all who participated, and may &b&lStarClan &7&llight your path."
                        reset {yourClan}
                        reset {otherClan}
                    else if {yourClanKills} < {otherClanKills}:
                        broadcast "&5&lStarlit &d&lForest&7&l>>&r &6&l%{otherClan}% has won the battle! &7&lGood job to all who participated, and may &b&lStarClan &7&llight your path."
                        reset {yourClan}
                        reset {otherClan}
                    else if {yourClanKills} = {otherClanKills}:
                        broadcast "&5&lStarlit &d&lForest&7&l>>&r &6&l%{otherClan}% &7&land &6&l%{yourClan}% &7&lhave tied. &7&lGood job to all who participated, and may &b&lStarClan &7&llight your path."
                        reset {yourClan}
                        reset {otherClan}
            else if {clan::loop-player} is {otherClan}:
                send action bar "&7Time left: %{battleTimeLeft}%%nl%&8&l%{yourClan}%: &6%{yourClanKills}% &8&l%{otherClan}%: &6%{otherClanKills}%" to loop-player"

How do I fix this? Thanks for the help!
 
send action bar is a thing.
do you have any errors when you reload it?
also i dont recommend using every tick loops as they cause lag
 
Status
Not open for further replies.