# Need help with boss attack code

**URL:** <https://forum.makecode.com/t/need-help-with-boss-attack-code/32000>\
**Category:** Help\
**Created:** [November 26, 2024, 5:40pm UTC](https://forum.makecode.com/t/need-help-with-boss-attack-code/32000 "2024-11-26T17:40:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Necromance](https://avatars.discourse-cdn.com/v4/letter/n/d07c76/32.png) [@Necromance](https://forum.makecode.com/u/Necromance)\
**Post date:** [November 26, 2024, 5:40pm UTC](https://forum.makecode.com/t/need-help-with-boss-attack-code/32000/1 "2024-11-26T17:40:17Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/9/3/93c3955da0e120901fbd44e9c4248e019131e583.png)  
game link: [https://arcade.makecode.com/S08167-86102-70447-13199](https://arcade.makecode.com/S08167-86102-70447-13199)

I’ve been trying to make it so when the attack finishes it restarts the code that called the function but all things I’ve tried haven’t worked.

---

<div class="post-metadata">

**Author:** ![redSprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/redsprite/32/34262_2.png) [@redSprite](https://forum.makecode.com/u/redSprite)\
**Post date:** [November 27, 2024, 7:49am UTC](https://forum.makecode.com/t/need-help-with-boss-attack-code/32000/2 "2024-11-27T07:49:30Z")

</div>

I’ll reconfigure the code to get it up and running.

> **[RedSprite Configured](https://arcade.makecode.com/43671-28242-82535-36332)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Check this out, maybe it solves your problems, just look at the code.

---

<div class="post-metadata">

**Author:** ![Necromance](https://avatars.discourse-cdn.com/v4/letter/n/d07c76/32.png) [@Necromance](https://forum.makecode.com/u/Necromance)\
**Post date:** [November 27, 2024, 7:53am UTC](https://forum.makecode.com/t/need-help-with-boss-attack-code/32000/3 "2024-11-27T07:53:35Z")

</div>

i have fixed this issue. I used a function instead of “on created sprite of kind boss” and replaced returned with call function
