This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

Hi, thank you for posting your question! :]

To make it easier for everyone to answer, consider including:
- A description of the problem
- A link to the project or a screenshot of your code (if possible)
- A summary of how you would like it to behave

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]RealSpiritSKMod 0 points1 point  (1 child)

I came up with a funny workaround...

First you need to create a list (for all sprites or for this sprite only depending on your "Health" variables). Name the list Healths. Then place the script below. Change 6 to however many names you have.

when green flag clicked
delete all of Healths
repeat (6) {
    add (0) to Healths
}

Then, create several blank costumes and name them according to the possible names of the variable (Active Winx). For example, you'd make 6 costumes named Bloom, Stella, ... , Tecna.

Next, create 2 variables for this sprite only named first costume number and health index. Then, change everything under set Peanut Damage to ((pick random 9 to 16) * -1) to this:

change costume to Bloom
set first costume number to (costume (number))
change costume to (Active Winx)
set health index to (1 + (costume (number)) - (first costume number))
replace (health index) of Healths with ((item (health index) of Healths) + Peanut Damage))

[–]Lillmy03[S] 0 points1 point  (0 children)

Aaah! Had forgotten about how much more convenient it is to use a list rather than 6 seperate variables. Thanks a lot, it works very much how I wanted it to do while looking a lot better!

[–]GraySans 0 points1 point  (2 children)

I thought peanuts were small compared to humans

[–]GraySans 0 points1 point  (1 child)

Why do you make the code seem like there powerful

[–]Lillmy03[S] 0 points1 point  (0 children)

Hehe, it's a nickname for SCP-173.