#why wont this loop work?

1 messages · Page 1 of 1 (latest)

vital junco
#

this is the code and everytyhing works but the loop

#

on swap hand items:
if all:
{ability::%uuid of player%} = "&6ᴘʏʀᴏ"
{abilityTier::%uuid of player%} = 2
{ability1::%uuid of player%::cooldown} = "&aʀᴇᴀᴅʏ!"
player is not sneaking
player is not holding a totem of undying
then:
if target player is set:
if {trustList::%uuid of player%::*} does not contain name of target player:
cancel event
set {ability1::%uuid of player%::cooldown} to "&7ᴀᴄᴛɪᴠᴇ..."
play sound "block.respawn_anchor.set_spawn" with volume 5 at pitch 2 at player
send "&6ʏᴏᴜ ʜᴀᴠᴇ ᴜꜱᴇᴅ ᴍᴇᴀᴛᴇʀᴏ ꜱʜᴏᴡᴇʀ!" to player
loop 5 times: # 20 fireballs, one every 3 seconds
if target player is alive:
set {_aboveLoc} to location of target player
set {_aboveLoc} to block 10 above {_aboveLoc}
spawn 1 of fireball at {_aboveLoc} with nbt from "{ExplosionPower:1.3}"
set {_fireball} to last spawned entity
set {_vec} to vector(0, -10, -5) # straight down
push {_fireball} {_vec} at force 2
wait 60 ticks # 3 seconds

hidden shale
#

this is not straight down

vital junco
#

it works tho

#

im not sure why

#

it just only shoots one fireball

hidden shale
#

a vector straight down would have only a y component, so vector(0, y, 0)

hidden shale
#

I dont see why these conditionals cant be in the if all: as well

vital junco
#

all the other abilties work fine with that

hidden shale
#

Well debug to find why your loop fails