helb

id: 750427

category: Help with Scripts

posts: 14

im coding a boss rush where if you click the boss it gets damaged and the next one appears BUT the hidden other bosses also register my clicks so they can get killed in the middle of a battle, causing 2 bosses to appear at once
posting the project could help

kingKASEtheGREATalt wrote:

posting the project could help
but that would spoil it

coolgreat1247 wrote:

kingKASEtheGREATalt wrote:

posting the project could help
but that would spoil it
it's hard to help with code without seeing the code you have, maybe post the mouse click script through the built-in scratchblocks?
when I receive [Attack v]
if <touching [mouse pointer v] ?> then
change [health v] by (-1)
end

coolgreat1247 wrote:

when I receive [Attack v]
if <touching [mouse pointer v] ?> then
change [health v] by (-1)
end
does the variable health edit every boss's health? that could be why

kingKASEtheGREATalt wrote:

coolgreat1247 wrote:

when I receive [Attack v]
if <touching [mouse pointer v] ?> then
change [health v] by (-1)
end
does the variable health edit every boss's health? that could be why
no, each boss has a seperate variable
ebeachhill ebeachhill loading
I have a solution. Maybe add a variable to tell which boss you're on, then only have that respective boss show up.
when I receive [ boss defeated v]
change [boss # v] by (1)

forever
if <(boss defeated) = [4]> then
show


else
hide
end
end

ebeachhill wrote:

I have a solution. Maybe add a variable to tell which boss you're on, then only have that respective boss show up.
when I receive [ boss defeated v]
change [boss # v] by (1)


if <(boss defeated) = [4]> then
show


else
hide
end
thats exactly what i did
ebeachhill ebeachhill loading
then why are multiple bosses showing up? (also tbh clicking is never the best way to kill a boss but ok)
make the bosses defeated variable global.
make all hp variables private.
make an if-else loop that every time the specific boss is killed, it changes bosses defeated by 1.
have you tried this?:
forever
if <<touching [ mouse pointer] ?> and <(boss defeated) = [4]>> then
...
end
end

kingKASEtheGREATalt wrote:

have you tried this?:
forever
if <<touching [ mouse pointer] ?> and <(boss defeated) = [4]>> then
...
end
end
yes
ebeachhill ebeachhill loading

coolgreat1247 wrote:

kingKASEtheGREATalt wrote:

have you tried this?:
forever
if <<touching [ mouse pointer] ?> and <(boss defeated) = [4]>> then
...
end
end
yes
here i don't even care about spoilers anymore just send the link you can send it on my profile if you want to

coolgreat1247 wrote:

kingKASEtheGREATalt wrote:

have you tried this?:
forever
if <<touching [ mouse pointer] ?> and <(boss defeated) = [4]>> then
...
end
end
yes
its hard to continue helping without the project