Discord Thread Issue with countdown skript

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

This thread came from the skUnity Discord. You can't reply to it here but if you join the skUnity Discord, you'll be able to post a reply there. The thread link is part of the thread's message.
Status
Not open for further replies.

skUnity Discord

Site Manager
Aug 5, 2023
12,755
0
0
The skUnity Discord
discord.gg
code_language.skript:
command /countdown [<integer>]:
    permission: eventcore.admin
    trigger:
        message "&c&l[!]&7 I will broadcast an message when the event starts!" to sender
        set {_countdown} to arg-1
        wait 1 minute
        remove 1 from {_countdown}
        if {_countdown} is 0:
            broadcast "&c&l[!]&7 Event is starting! The host will revive everyone shortly."
            set bossbar "novaeventbar" title to "&b&lEVENT:&r %{_arg1}%, &b&lHOST:&r %{_arg2}% &b&lALIVE:&r %size of {alive::*}%"
        if {_countdown} is 1:
            broadcast "&c&l[!]&7 Event is starting in 1 minute!"
        else:
            broadcast "&c&l[!]&7 Event is starting in %{_countdown}% minutes!"
When the countdown hits 0 it wont broadcast anything or change the bossbar. What do i do?

Posted by: notazex from the skUnity Discord. View the thread on skUnity Discord here
 
I need to use variables because i set the bossbar thru a different skript this skript just adds the alive counter to it
And i cant use spaces in arg-1
So i had to make it a variable for that reason too
I made it so that underscores are replaced with a space

Posted by: notazex from the skUnity Discord.
 
Because when the countdown hits 0 it's supposed to add alive counter to the bossbar
oH
I use a command for the bossbar
I use the command to edit it
This countdown skript just adds the alive counter to it when the event starts
code_language.skript:
command /countdown [<integer>]:
    permission: eventcore.admin
    trigger:
        message "&c&l[!]&7 I will broadcast an message when the event starts!" to sender
        set {_countdown} to arg-1
        while {_countdown} > 0:
            wait 1 minute
            remove 1 from {_countdown}
            broadcast "&c&l[!]&7 Event is starting in %{_countdown}% minutes!"
            if {_countdown} is 0:
                broadcast "&c&l[!]&7 Event is starting! The host will revive everyone shortly."
                set bossbar "novaeventbar" title to "&b&lEVENT:&r %{_arg1}%, &b&lHOST:&r %{_arg2}% &b&lALIVE:&r %size of {alive::*}%"
            if {_countdown} is 1:
                broadcast "&c&l[!]&7 Event is starting in 1 minute!"
so like this?

Posted by: notazex from the skUnity Discord.
 
ohh
my bad
let me try
Almost works
It broadcasts both "event starts in 1 minutes" and "event starts in 1 minute"
But other than that it works perfectly
also, this happens when it sets the bossbar

code_language.skript:
command /eventbar [<text>] [<text>]:
    permission: eventcore.admin
    trigger:
        set {_arg1} to arg-1
        set {_arg2} to arg-2
        replace all "_" with " " in {_arg1}
        set {eventbar} to bossbar named "novaeventbar"
        create bossbar titled "&b&lEVENT:&r %{_arg1}%, &b&lHOST:&r %colored arg-2%" and id "novaeventbar" for players with progress 100 with colors blue
        wait 1 tick
        if arg-1 and arg-2 isn't set:
            hide bossbar "novaeventbar"
Here's the skript that i use for the bossbar

Posted by: notazex from the skUnity Discord.
 
code_language.skript:
command /countdown [<integer>]:
    permission: eventcore.admin
    trigger:
        message "&c&l[!]&7 I will broadcast an message when the event starts!" to sender
        set {_countdown} to arg-1
        while {_countdown} > 0:
            broadcast "&c&l[!]&7 Event is starting in %{_countdown}% minutes!"
            wait 1 minute
            remove 1 from {_countdown}
            if {_countdown} is 0:
                hide bossbar "novaeventbar"
                broadcast "&c&l[!]&7 Event is starting! The host will revive everyone shortly."
                create bossbar titled "&a&lThe Event Is Starting!" and id "event.startingbar" for player with progress 100 with colors green
                wait 5 ticks
                loop 100 times:
                    set {_BarValue} to value of bossbar "event.startingbar"
                    remove 1 from {_BarValue}
                    set bossbar "event.startingbar" value to {_BarValue}
                    wait 3 ticks
                remove bossbar "event.startingbar"
                create bossbar titled "&b&lEVENT:&r %{_arg1.%player's uuid%}%, &b&lHOST:&r %{_arg2}% &b&lALIVE: %size of {alive::*}%" and id "eventbar2" for players with progress 100 with colors blue
                if {_countdown} is 1:
                    broadcast "&c&l[!]&7 Event is starting in 1 minute!"

Posted by: notazex from the skUnity Discord.
 
code_language.skript:
command /countdown [<integer>]:
    permission: eventcore.admin
    trigger:
        message "&c&l[!]&7 I will broadcast an message when the event starts!" to sender
        set {_countdown} to arg-1
        while {_countdown} > 0:
            broadcast "&c&l[!]&7 Event is starting in %{_countdown}% minutes!"
            wait 1 minute
            remove 1 from {_countdown}
        hide bossbar "novaeventbar"
        broadcast "&c&l[!]&7 Event is starting! The host will revive everyone shortly."
        create bossbar titled "&aThe Event Is Starting!" and id "event.startingbar" for player with progress 100 with colors green
        wait 5 ticks
        loop 100 times:
            set {_BarValue} to value of bossbar "event.startingbar"
            remove 1 from {_BarValue}
            set bossbar "event.startingbar" value to {_BarValue}
            wait 3 ticks
        remove bossbar "event.startingbar"
        show bossbar "novaeventbar"
        broadcast "&c&l[!]&7 Event is starting in 1 minute!"

Posted by: notazex from the skUnity Discord.
 
Status
Not open for further replies.