Bug with invisibility ring

even when i use canCast this happens

1 Like

What exactly is going wrong when casting something? Because from that picture, I see nothing wrong

You’re not supplying enough information to enable anyone to help you. Write a brief description of what’s wrong and post your code.

@MunkeyShynes, it’s probably not the code he’s talking about, just a visual bug. But from that pic, all I can infer is that a bunch of ogres are there and his hero is at 45 HP. :man_shrugging:

Either way, a description of what he’s talking about would be very helpful.

1 Like

anyway sorry for necroposting and stuff but i think what he means is that he used canCast but it says no target
image
aka no one to cast the invis on (once again i apologize in advance for necroposting)

You don’t need a target when using canCast; its there to see if you can cast on that target specifically, like if they already have grow and you want to cast grow on them or something.

if (hero.canCast("invisibility", somebody)) {
    hero.cast("invisibility", somebody)
}

the somebody requires a specific variable

But you don’t always need to use that part of the function; you can just see if the cool-down is ready or not. I.E. hero.canCast("invisibility")

yea but i think he was tryna cast invis on himself

you can cast invis on your self

But you don’t need to check if you can cast invis on yourself unless someone else casted invis on you, in which case you can’t cast invis on yourself specifically. If you can cast invis at all, you can cast it on yourself.