Discuss Scratch

shadowcatking1234567
New Scratcher
4 posts

Working Script?

I want to know why my script wont work, and I've been troubleshooting for hours! If any of you could please help me, I would be very thankful!
My script is meant to do a set amount of damage to the orc when they meet, but for some reason it doesn't work quite right.
The script is in “Enemy”
I just shared the project. If you could figure it how, please let me know. Name is “Knight Game Remastered”
10goto10
Scratcher
1000+ posts

Working Script?

I'm guessing that the issue is the orc dies as soon as it touches the sword even though each touch is only supposed to do partial damage. However, the damage is being done to the orc every other frame and at 15 frames per second the orc will appear to be killed instantly.

I remixed your project for just a single case of enemy 1 against the short sword. When an “enemy 1” clone touches the sword it now staggers back a little bit to give us a chance to see that some damage was done by that touch.

https://scratch.mit.edu/projects/1370077164/
shadowcatking1234567
New Scratcher
4 posts

Working Script?

Thank you for helping me with the damage and instant death problem, but could you help me fix the sword damage issue?

Last edited by shadowcatking1234567 (Aug. 20, 2026 17:57:51)

10goto10
Scratcher
1000+ posts

Working Script?

I tried my best to guess what you meant by the sword damage issue and that’s why I guessed it was the instant death issue. So I’m going to need a little more description of the sword damage issue.

I did notice that OrcLives3 is a ‘for all sprites’ variable so all enemy3 sprites share the same value of OrcLives3.

shadowcatking1234567
New Scratcher
4 posts

Working Script?

What it's supposed to be, is a lives system that subtracts based on the costume of the orc. When 1-0 is pressed it switches the costume of the orc, of the player, and of the sword. This same system is how the different weapon, different turn speed thing works. I suggest using Rapier (2) for trying to debug due to it doing 1 damage.
Also, I meant to say thank you for helping with the instant death issue, not the instant death issue and damage issue, sorry!

Last edited by shadowcatking1234567 (Aug. 20, 2026 19:18:34)

10goto10
Scratcher
1000+ posts

Working Script?

I put my fall back code into the Rapier code section of the enemy sprite as well as a say block so things would slow down and we we can see the damage happening on the screen. In your script the damage was being done but the wait between decrementing “orc lives” when touching the rapier was programmed to be 0.05 seconds. That's too quick to be seen.

I didn't make a new remix. I just modified my exiting program: https://scratch.mit.edu/projects/1370077164/
shadowcatking1234567
New Scratcher
4 posts

Working Script?

Oh, ok! Thank you so much for helping me with my problems!

Powered by DjangoBB