Random Firework Attributes

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

hogbits

Member
Jun 5, 2023
1
0
1
48
I am trying to randomize firework attributes using vanilla skript. I wanted to randomize the firework type, color, and effect so I tried the following:

Code:
on load:
    clear {fireworkAttr::*}
    add "gold" to {fireworkAttr::color::*}
    add "blue" to {fireworkAttr::color::*}
    add "green" to {fireworkAttr::color::*}
    add "aqua" to {fireworkAttr::color::*}
    add "red" to {fireworkAttr::color::*}
    # Repeat for all attributes
command /rfw:
    trigger:
        set {_fireworkColor1} to a random element out of {fireworkAttr::color::*}
        send "The random color is %{_fireworkColor1}%" to player
        launch flickering trailing burst firework colored {_fireworkColor1} at player

What is the correct way to code this?