Why does it shoot a flame arrow every time

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

    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.

JustADev

Well-Known Member
Apr 8, 2017
379
9
18
Why is the chance for the arrow becoming a flame arrow 100%?

Code:
code_language.skript:
on shoot:
    set {CBL::%shooter%} to 0.3 * {BlazingArrowsMAX::%shooter%} + 1
    chance of {CBL::%shooter%}:
        projectile is arrow:
            if {BlazingArrows::%shooter%} is more than 0:
                wait 1 tick
                set projectile on fire
                send "&8[&6Ability&8] &7Your &aBlazing Arrows Perk &7just activated" to shooter
 
Why is the chance for the arrow becoming a flame arrow 100%?

Code:
code_language.skript:
on shoot:
    set {CBL::%shooter%} to 0.3 * {BlazingArrowsMAX::%shooter%} + 1
    chance of {CBL::%shooter%}:
        projectile is arrow:
            if {BlazingArrows::%shooter%} is more than 0:
                wait 1 tick
                set projectile on fire
                send "&8[&6Ability&8] &7Your &aBlazing Arrows Perk &7just activated" to shooter
I'd just replace the chance system you are using, with something simpler that you know how to do...
 
Flaming Arrows:
code_language.skript:
on shoot:
    set {CBL::%shooter%} to 0.3 * {BlazingArrowsMAX::%shooter%} + 1
    chance of {CBL::%shooter%}:
        if {BlazingArrows::%shooter%} is more than 0:
            wait 1 tick
            ignite projectile
            send "&8[&6Ability&8] &7Your &aBlazing Arrows Perk &7just activated" to shooter

Variables:
code_language.skript:
on rightclick with emerald:
    name of player's tool is "&6Perks &7(Right Click)":
        set {CHL.%player%} to {Health::%player%} * 0.5
        set {CSL.%player%} to 0.1 * {Strength::%player%}
        set {CPL.%player%} to 0.2 * {Poison::%player%} + 2
        set {CSLO.%player%} to 0.2 * {Slowness::%player%} + 2
        set {CLL.%player%} to 0.1 * {Lightning::%player%}
        set {CSCL.%player%} to 0.8 * {Strength::%player%}
        set {CPCL.%player%} to 0.3 * {Poison::%player%} + 1
        set {CSLCL.%player%} to 0.3 * {Slowness::%player%} + 1
        set {CLSCL.%player%} to 0.2 * {Lightning::%player%} + 1
        set {CBL.%player%} to 0.3 * {BlazingArrows::%player%} + 1
    if {StrengthMAX::%player%} is 10:
        set {StrengthMAX::%player%} to "&c10"
        set {S1::%player%} to "&c10"
    if {HealthMAX::%player%} is 20:
        set {HealthMAX::%player%} to "&c20"
        set {H1::%player%} to "&c20"
    if {PoisonMAX::%player%} is 20:
        set {PoisonMAX::%player%} to "&c20"
        set {P1::%player%} to "&c20"
    if {SlownessMAX::%player%} is  20:
        set {SlownessMAX::%player%} to "&c20"
        set {SL1::%player%} to "&c20"
    if {LightningMAX::%player%} is 40:
        set {LightningMAX::%player%} to "&c40"
        set {L1::%player%} to "&c40"
    if {BlazingArrowsMAX::%player%} is 20:
        set {BlazingArrowsMAX::%player%} to "&c20"
        set {B1::%player%} to "&c20"
 
no matter what {BlazingArrowsMAX::%shooter%} is youre adding 1 to the chance so its always over 100%. for example if {BlazingArrowsMAX::%shooter%} is 0.5 then that times 0.3 is 0.15 then you add 1 to that so the chance is 115%
 
Its not that I dont know how to do chance, it's just that I can't set {CBL::%shooter%} to a variable when a player right clicks an item because there is not a shooter event, so the chance is 100%
 
{BlazingArrowsMAX::%player%} is set to a string. Convert it to an integer/number. Also, learn how to "debug" because it will help you resolve your problem.
 
Status
Not open for further replies.