# Bug with invisibility ring

**URL:** https://discourse.codecombat.com/t/bug-with-invisibility-ring/15999
**Category:** Bugs
**Created:** [September 21, 2018, 5:47pm UTC](https://discourse.codecombat.com/t/bug-with-invisibility-ring/15999 "2018-09-21T17:47:27Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Archion](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/archion/32/26234_2.png) [@Archion](https://discourse.codecombat.com/u/Archion)
#### Post date: [September 21, 2018, 5:47pm UTC](https://discourse.codecombat.com/t/bug-with-invisibility-ring/15999/1 "2018-09-21T17:47:27Z")

</div>

even when i use canCast this happens

 ![da7fcf3d-7fd8-4a18-862e-b35a80416f63](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/5/51165c519ed45d646af1ced47cca67076da17a92.jpeg)

---

<div class="post-metadata">

### Author: ![Chaboi\_3000](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/chaboi_3000/32/48486_2.png) [@Chaboi\_3000](https://discourse.codecombat.com/u/Chaboi_3000)
#### Post date: [September 21, 2018, 8:57pm UTC](https://discourse.codecombat.com/t/bug-with-invisibility-ring/15999/2 "2018-09-21T20:57:48Z")

</div>

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

---

<div class="post-metadata">

### Author: ![MunkeyShynes](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/munkeyshynes/32/9277_2.png) [@MunkeyShynes](https://discourse.codecombat.com/u/MunkeyShynes)
#### Post date: [September 21, 2018, 9:01pm UTC](https://discourse.codecombat.com/t/bug-with-invisibility-ring/15999/3 "2018-09-21T21:01:28Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Chaboi\_3000](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/chaboi_3000/32/48486_2.png) [@Chaboi\_3000](https://discourse.codecombat.com/u/Chaboi_3000)
#### Post date: [September 21, 2018, 9:59pm UTC](https://discourse.codecombat.com/t/bug-with-invisibility-ring/15999/4 "2018-09-21T21:59:22Z")

</div>

@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. 🤷‍♂️

---

<div class="post-metadata">

### Author: ![MunkeyShynes](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/munkeyshynes/32/9277_2.png) [@MunkeyShynes](https://discourse.codecombat.com/u/MunkeyShynes)
#### Post date: [September 21, 2018, 11:01pm UTC](https://discourse.codecombat.com/t/bug-with-invisibility-ring/15999/5 "2018-09-21T23:01:35Z")

</div>

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

---

<div class="post-metadata">

### Author: ![NalfarCryptor](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/nalfarcryptor/32/37572_2.png) [@NalfarCryptor](https://discourse.codecombat.com/u/NalfarCryptor)
#### Post date: [November 30, 2023, 2:25am UTC](https://discourse.codecombat.com/t/bug-with-invisibility-ring/15999/7 "2023-11-30T02:25:30Z")

</div>

anyway sorry for necroposting and stuff but i think what he means is that he used canCast but it says no target  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/0/f/0ffa8b5128b9cc8cfd33cafa5d582ec6b8aef41f.png)  
aka no one to cast the invis on (once again i apologize in advance for necroposting)

---

<div class="post-metadata">

### Author: ![JustALuke](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/justaluke/32/43608_2.png) [@JustALuke](https://discourse.codecombat.com/u/JustALuke)
#### Post date: [November 30, 2023, 2:48am UTC](https://discourse.codecombat.com/t/bug-with-invisibility-ring/15999/8 "2023-11-30T02:48:33Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![NalfarCryptor](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/nalfarcryptor/32/37572_2.png) [@NalfarCryptor](https://discourse.codecombat.com/u/NalfarCryptor)
#### Post date: [November 30, 2023, 3:03am UTC](https://discourse.codecombat.com/t/bug-with-invisibility-ring/15999/9 "2023-11-30T03:03:10Z")

</div>

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

```

the somebody requires a specific variable

---

<div class="post-metadata">

### Author: ![JustALuke](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/justaluke/32/43608_2.png) [@JustALuke](https://discourse.codecombat.com/u/JustALuke)
#### Post date: [November 30, 2023, 2:10pm UTC](https://discourse.codecombat.com/t/bug-with-invisibility-ring/15999/10 "2023-11-30T14:10:30Z")

</div>

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")`

 ![Screenshot from 2023-11-30 08-09-30](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/f/0/f0df9f6f3dbffa6b8a6dce5883f504fe9a482363.jpeg)

---

<div class="post-metadata">

### Author: ![NalfarCryptor](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/nalfarcryptor/32/37572_2.png) [@NalfarCryptor](https://discourse.codecombat.com/u/NalfarCryptor)
#### Post date: [November 30, 2023, 11:08pm UTC](https://discourse.codecombat.com/t/bug-with-invisibility-ring/15999/11 "2023-11-30T23:08:40Z")

</div>

yea but i think he was tryna cast invis on himself

---

<div class="post-metadata">

### Author: ![TheCodingCrusader22](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/thecodingcrusader22/32/46084_2.png) [@TheCodingCrusader22](https://discourse.codecombat.com/u/TheCodingCrusader22)
#### Post date: [November 30, 2023, 11:33pm UTC](https://discourse.codecombat.com/t/bug-with-invisibility-ring/15999/12 "2023-11-30T23:33:53Z")

</div>

you can cast invis on your self

---

<div class="post-metadata">

### Author: ![JustALuke](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/justaluke/32/43608_2.png) [@JustALuke](https://discourse.codecombat.com/u/JustALuke)
#### Post date: [November 30, 2023, 11:35pm UTC](https://discourse.codecombat.com/t/bug-with-invisibility-ring/15999/13 "2023-11-30T23:35:48Z")

</div>

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.

 ![Screenshot from 2023-11-30 17-33-08](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/d/7/d7c081ef5856af3a77bc45f3218c940c9f3e998a.jpeg)
